var _SVGData = { _width: 584, _height: 842, series: [
	{
		_id: "_path_0", path: "M747.7,516.99c-1.86-3.91-5.01-9.67-7.06-10.23c0,0-0.54-0.75-1.24-1.78c-0.32-0.48-0.67-1.01-1.02-1.57   l-1.12,0.37c-0.47,1.44-2.76,7.81-3.43,10.96c-0.67,3.16-2.29,6.7-1.7,9.27s1.38,8.28,1.18,10.65c-0.2,2.37,2.21,11.26,2.21,11.26   c0.87-0.29,1.91-0.58,3.02-0.8c2.71-0.53,5.85-0.62,7.98,0.8c3,2,7,2,8,1s4-4,4-9l0.72-15.21   C759.24,522.72,749.56,520.9,747.7,516.99z"
	}, { 
		_id: "_path_1", path: "M690.52,520.92c-1,5-1,12,1,14s6,6,11,6s9-3,10-3s5-1,5,2s0,12,1,13s5,6,9,5s4-1,5-4s0-7,3-8   c0,0-2.4-8.9-2.21-11.26c0.2-2.37-0.59-8.09-1.18-10.65s1.02-6.11,1.7-9.27c0.67-3.16,2.96-9.53,3.43-10.96c0,0,0,0-4.14,0   s-5.52,0.71-9.52,0c-3.99-0.71-3.89-1.26-7.44,0c-3.55,1.26-7.1-2.86-7.1-2.86s-7.1,0.41-13.41,0c-3.87-0.25-7.59,3.59-9.84,6.83   C688.5,510.87,691.29,517.07,690.52,520.92z"
	}, { 
		_id: "_path_2", path: "M695.65,500.92c6.31,0.41,13.41,0,13.41,0s3.55,4.12,7.1,2.86c3.55-1.26,3.45-0.71,7.44,0   c3.99,0.71,5.37,0,9.52,0s4.14,0,4.14,0c0.06-0.2,0.45-0.36,1.04-0.49c-1.09-1.74-2.11-3.63-1.95-4.36   c0.03-0.13-0.08-0.37-0.28-0.69c-2.29,1.01-9.95-4.07-11.03-3.7c-1.23,0.43,0.31,0.8-2.45,3.83c-2.76,3.03-2.45-1.19-7.96-3.83   c-5.51-2.64-6.13-4.78-9.19-6.92c-3.06-2.14-1.53-4.29-3.06-0.31s-2.76,5.51-4.29,3.37c-1.53-2.14-2.83-7.75-2.83-7.75h-9.75l-7,5   c0,0-6,0-4,11l3,3c0,0,3,3,6,4c0.69,0.23,1.49,0.9,2.29,1.83C688.06,504.51,691.78,500.67,695.65,500.92z"
	}, { 
		_id: "_path_3", path: "M748.4,459.65c-1.75-2.08-4.09-4.36-6.62-5.45c-5.26-2.28-9.31-5.03-11.28-4.66s-3.99-1.59-4.48,4.39   c-0.49,5.98,0.51,9.98,0.51,9.98s2.26,1-0.37,9.5c0,0-0.63,2.5-2.63,4.5s-4.9,3.92-5.95,3.96c-1.05,0.04-3.39-0.43-4.72-2.19   s-2.15-2.58-2.74-2.17c-0.59,0.41-2.52-0.53-7.55,1.94c-5.04,2.47-4.55,2.47-7.29,3.47c0,0,1.3,5.61,2.83,7.75   c1.53,2.14,2.76,0.61,4.29-3.37s0-1.84,3.06,0.31c3.06,2.14,3.68,4.29,9.19,6.92c5.51,2.64,5.21,6.86,7.96,3.83   c2.76-3.03,1.23-3.4,2.45-3.83c1.07-0.37,8.74,4.71,11.03,3.7c0.32-0.14,0.54-0.4,0.61-0.82c0.61-3.37-3.68-6.43-4.59-14.49   c-0.92-8.06,5.21-2.66,6.74-5.72s6.13-3.98,8.27-3.78s4.42-9.5,4.42-9.5S750.3,461.91,748.4,459.65z"
	}, { 
		_id: "_path_4", path: "M785.52,492.92c-2.99-3.98-9.39-7.99-9.45-8.02c0,0,0,0,0,0c-0.06-0.03-6-3.16-11.26-4.07   c-5.29-0.91-8.14-4.19-10.71-8.05c-1.99-2.99-2.44-6.65-2.54-8.16c-0.01-0.12-0.17-0.13-0.2-0.02c-0.56,2.2-2.45,8.99-4.25,8.82   c-2.14-0.2-6.74,0.71-8.27,3.78s-7.66-2.34-6.74,5.72c0.92,8.06,5.21,11.12,4.59,14.49c-0.08,0.42-0.29,0.68-0.61,0.82   c0.2,0.32,0.31,0.55,0.28,0.69c-0.16,0.74,0.86,2.63,1.95,4.36c0.03,0.04,0.05,0.08,0.07,0.12l1.02,1.54   c0,0.02,0.01,0.03,0.02,0.05c0.62,0.92,1.12,1.61,1.21,1.74c0.01,0.02,0.02,0.02,0.04,0.03c2.06,0.6,5.18,6.33,7.03,10.22   c1.74,3.66,10.35,5.49,11.43,5.7c0.06,0.01,0.11-0.03,0.12-0.1l0.27-5.67v-10.19v-3.8c0-0.01,0-0.01,0-0.01   c0.03-0.14,1.07-4.98,6-4c5,1,14,1,17,0S788.52,496.92,785.52,492.92z"
	}, { 
		_id: "_path_5", path: "M802.02,482.92c-0.5,0-7.21,0.4-8.36,0.2s-4.14-0.2-5.14,0.8s-5.5,5.5-5.5,5.5s3.67,3.35,3.58,5.42   c-0.08,2.08-0.08,3.08-4.08,4.08s-12.04,0.76-14.52,0.38c-2.48-0.38-6.76-0.38-7.62,1.62s-1.14,21.79-1.14,21.79   s-0.3,15.87-1.01,18.04c-0.71,2.17-1.71,5.17-3.71,6.17l16,17c0,0,9,12,10,13s4,4,5,3s1-1,1-1s-0.51-1.67,0.24-3.83   c0.76-2.17,6.24-6.29,9.5-7.73c3.26-1.44,5.26-2.44,5.26-2.44s6.57,0.15,8.78,1.57c2.22,1.43,3.66,3.23,6.44,3.83   c2.78,0.6,4.78,1.6,7.78,0.6s3.55-0.54,4.78-2.77c1.22-2.23,1.41-7.97,1.31-10.1s-2.09-7.13,1.91-6.13s8.81,3.08,11.4,2.54   s5.46-2.53,5.46-2.53s1.93-1.41-4.47-5.21c-6.4-3.81-5.43-5.52-5.41-9.16c0.01-3.64-0.11-10.45-0.05-10.05   c0.06,0.4,0.03-3.37,1.54-4.48c0,0,1-2.16,1.76-2.64c0.76-0.48,6.76-2.48,6.76-2.48s1.89-0.89,1.45-5.44l-2.02-6.8   c0,0-1.17-3.92-1.8-5.34s-3.22-3.8-4.92-5.11c0,0-4.95-2.15-5.33-2.23c-0.38-0.08-2.38-1.08-7.38-1.08s-10.87-2.38-10.87-2.38   L802.02,482.92z"
	}, { 
		_id: "_path_6", path: "M766.52,622.92c0,0,6.08-5.44,7.54-7.72c1.46-2.28,2.46-5.28,3.46-7.28s3.05-8.5,4.02-10.25   c0.98-1.75,5.88-5.74,5.93-9.74c0.05-4.01-0.95-9.01-0.95-9.01l-1,1c0,0-2.05,1.1-8.52-7.45c-6.48-8.55-17.38-20.13-17.38-20.13   l-5.1-5.42c0,0-2.3,0-4.65,0c-2.35,0-4.46-2.22-6.9-2.11c-2.45,0.11-7.45,1.11-7.45,1.11s-3,0-3,8c0,0,0.83,2.31-2.08,3.15   c-2.92,0.85-4.13,0.89-5.02,0.87c-0.89-0.02-6.89-5.02-6.89-5.02l-1-13c0,0-0.18-4.36-8.09-0.68s-13.91-0.66-13.41-0.49   s-5.54-1.95-6.02-8.39c-0.48-6.44,0.52-7.44,0.52-9.44s-1.24-9.91-4.12-12.45s-11.88-6.55-11.88-9.55l-6.33,6.91   c0,0-6.02,5.65-6.84,7.87c-0.82,2.22-5.82,5.22-5.82,5.22s-3.9,0.4-7.45,0.2c-3.55-0.2-3.55-0.2-3.55-0.2s0,1-3,2   s-3.81-1.39-3.81-1.39l3.81,13.39c0,0,4,7,4,8s-0.18,7.22,1,8c3,2,4,3,6,7s4,7,6,9s10,0,10,0s3,1,4,1s5,2,5,3s0,5,3,8s8,5,9,9   s2,9,0,12s-3,0-4,5s-2,7-3,11s1,5,0,9s2.53,5.62,2.53,5.62s3.47,3.38,5.47,3.38s4.91-0.5,7.45,6.75c2.55,7.25,1.55,9.25,7.55,12.25   s13,1,15,1s4-1,6,1s5,6,9,7s14,0,14,0s5.23,2.5,7.62-6.25c2.38-8.75-0.03-6.73,0.68-12.24c0.71-5.51,4.54-2.16,6.62-4.83   c2.08-2.68,3.42-1.17,1.25-8.93S766.52,622.92,766.52,622.92z"
	}, { 
		_id: "_path_7", path: "M685.52,482.92l-7,5c0,0-3,0-4,3s0,7,0,8s0,2-3,4s-5,5-8,8c-3,3-3,6-8,8s-9-1-11,0s-1,2-3,2s-5-1-8-7   c-3-6-8-19-8-19s-6-14-5-21c0,0-1-4-3-5s-2.63-1.85-2.63-1.85s3.28-0.25,3.95-5.7c0.67-5.45,0.67-3.45,0.67-3.45l-5.45-5.41   c0,0-2.4-3.3-1.97-6.44c0.43-3.15,0.43-3.15,0.43-3.15s-5.59-13.21-5.29-14.61c0.29-1.39,1.29-2.39,1.29-2.39l4.55,8.71l8.45,6.29   c0,0,7.87,4.95,8.93,5.97s9.07,7.03,11.07,11.03s12,15,20,16s17.08,5.96,17.08,5.96L685.52,482.92z"
	}, { 
		_id: "_path_8", path: "M614.52,424.92c-4,0-6.38,0.92-6.38,0.92l3.38,7.08c0,0,4,5,10,8s17,12,20,17s11,14,20,16s24,9,24,9s4,0,8,0   s8-3,10-4s7-2,8-1s9-5,9-11s-6-13-6-13s-2-6-5-7s-12-11-14-11s-5,0-7-2s-4-7-3-11s-2-14-11-17s-18-4-18-4s-15.22-7.96-23.86-10.69   c-6.85-2.17-5.52,1.81-5.08,5.49c0.48,4.05,1.66,10.34,0.83,15.58"
	}, { 
		_id: "_path_9", path: "M760.02,424.42c0,0,0,8,5,9s16,0,16,0s4,5,5,12s3,19,4,23s7,13,9,14s-9,0-11,2s-5,5-5,5s-6-5-13-7s-10-3-14-7   s-4-11-4-11s-6-9-12-11s-11-6-13-3s-1,13,0,14s0,11-4,14s-6,4-8,3s-4-4-4-4s8-2,9-10s-6-14-6-14s-6-8-5-7s-6.9-5.4-6.9-5.4   s-3.77-5.89-9.44-5.24s-7.06-6.41-7.36-9.38c-0.3-2.98,1.7-7.98-3.3-14.98l11.37-8.21l11.63-6.79l8.6-5.7c0,0,4.07-2.92,9.73,3.39   c5.67,6.31,7.42,8.52,7.42,8.52l11.33,0.62c0,0,3.92-0.83,5.92,2.17s6,2,6,2s3.32,2.28,6.16,2.14L760.02,424.42z"
	}, { 
		_id: "_path_10", path: "M822.52,427.92c0,0-5,13-6,16s-1,10,5,14s4,3,10,4s18,0,18,0s5,0,6,0s2,5,0,7s-5,6-3,9s5,2,7,5s1,12,0,14   s-9,2-10,3s-2,1-2,1s-3-5-6-6s-5-3-12-3s-20-6-20-6l-10-4c0,0-3.84-1.09-6.42-7.05c-2.58-5.95-4.76-6.76-5.17-17.36   c-0.41-10.59-3.06-18.47-5.23-21.53c-2.18-3.06-2.18-3.06-2.18-3.06s-13.92,1.88-16.96-0.06c-3.04-1.94-3.99-7.79-3.52-10.87   s0.47-12.07,0.47-12.07s12-1,12,0s1.58,7.21,1.79,7.11c0.21-0.11,1.34,3,5.27,0.95c3.94-2.05,8.94-5.05,10.94-7.05l19,1   c0,0,0,5,2,6s9,6,10,8S822.52,427.92,822.52,427.92z"
	}, { 
		_id: "_path_11", path: "M850.52,510.92c0,0,2,5-1,7s-8,1-8,5c0,0,1.65,1.67,4.83,3.34c3.17,1.66,5.17,3.66,10.17,2.66   s13.4-3.88,17.7-6.94c4.3-3.06,5.3-3.06,6.3-6.06s5-7,10-5c5,2,14,6.27,16.5,7.64c2.5,1.36,5.5,3.36,5.5,3.36s3.09,1.24,6.54,1.12   c3.46-0.12,7.46-1.12,7.46,0.88s-3.67,11.58-2.84,14.79c0.84,3.21,4.58,6.95,9.71,12.08s13.13,13.13,13.13,13.13   s9.71,5.29,17.85,1.64s9.56-4.37,10.85-4.5c1.29-0.14,5.29-0.14,12.29,0.86s6.89-3.88,6.94-6.44c0.06-2.56,0-12.95,0-12.95   s1.06-4.61-8.94-1.61c0,0-3-7-6-8s-9.88,4.17-5.94-6.41c0,0,1.14-2.54,2.04-5.56c0.9-3.02,0.9-10.02,0.9-10.02s-5-4-8-3   c0,0-1.07-8.57-5.04-10.79c-3.96-2.21-5.91-1.61-6.44-3.91c-0.52-2.3,2.72-3.71,4.1-5.51s2.24-3.65-3.69-3.22s-6.93-0.57-8.93-2.57   s-2-10-5-14s-8.01-2.17-10-7.58c-2-5.42-3,0.58-3-10.42s-10.79-10.14-17.39-12.57c-6.61-2.43-21.11-6.24-25.86-9.34   c-4.75-3.09-12.75-7.09-11.75-21.09c0,0-8.74-11.09-18.37-11.54s-9.63-0.46-9.63-0.46s-6.51,4.76-10.25,5.38   s-18.31,2.28-21.53,3.95c-3.22,1.67-6.22,6.67-6.22,6.67s-1,4,2,7s12,7,11,10s-5.98,14.13-6.49,19.57   c-0.51,5.43,5.49,10.43,5.49,10.43s1.49,2.68,5.74,3.34c4.26,0.66,12.82,1.25,17.54,0.95c4.72-0.29,10.72-0.29,10.72-0.29s3,4,0,7   s-5,6-3,9s5,2,7,5s1,10,0,14c0,0,0.73-0.05-5.63,1.98s-6.37,2.02-6.37,2.02L850.52,510.92z"
	}, { 
		_id: "_path_12", path: "M975.02,563.42c0,0,0,13-2,21s2,12,1,18s2,9-6,9s-8-4-13,4s-7,25-14,26s-12,5-16,6s-6-2-7-5s0-3-6-5   s-11-1-14-3s-8-1-11,5s-10,7-12,8s3,19-3,18s-8-5-11-5s0-2-7,5s-1,13-8,14s-9-5-10,0s-2,9-7,3s-11-16-14-19s-13,0-16-3   s-15-13-15-13s-11,8-14-3s-3-10-3-10s-2.23-9.78-2.12-10.89s0.4-1.15,0.4-1.15s0.42-0.32,1.21,0.54c0,0,6.43-5.7,7.54-7.72   s4.23-9.08,4.64-10.2c0.41-1.12,1.98-6.17,2.84-7.33c0.86-1.16,2.25-2.7,4.86-6.3c2.61-3.59,0.28-8.66,0.12-12.45   c-0.17-3.8,0.05-4.18,2.28-6.44c2.23-2.26,5.77-4.31,7.46-5.12c1.69-0.81,5.26-2.44,5.26-2.44s3.77,0.06,5.75,0.57   c1.98,0.51,2.46,0.56,4.6,2.13c2.14,1.57,1.94,1.56,2.81,1.95c0.87,0.39,5.33,1.55,5.33,1.55s2.55,0.59,4.52-0.2   c1.97-0.79,2.45-0.46,3.46-1.14c1-0.68,2.03-2.45,2.3-5.26s0.3-5.96,0.1-8.08s-0.56-3.66,0.09-4.23c0.66-0.57,1.3-0.58,4.01,0.26   c2.71,0.84,5.28,1.62,6.19,1.79c0.9,0.17,2.74,0.58,4.45-0.14c1.71-0.72,3.86-1.7,4.26-2.19c0.4-0.48,0.36-1.13-0.14-1.75   c-0.51-0.62-0.7-1.05-2.8-2.5c-2.1-1.45-2.51-1.5-3.45-2.2c-0.94-0.71-1.89-1.41-2.43-2.16c-0.55-0.74-1.08-1.02-1.07-4.83   c0.01-3.81-0.04-9.42-0.04-9.42s-0.24-5.26,1.56-6.05l0.52-0.11l4.83,3.34c0,0,2.52,1.62,3.89,2.12c1.36,0.49,3.5,1.39,7.06,0.42   s7.82-2.02,12.14-4.15s8.34-5.07,8.66-5.32c0.33-0.25,2.04-1.64,2.21-2.82c0.17-1.18,1.65-3.92,3.72-4.97   c2.07-1.05,3.58-1.53,5.44-0.95c1.86,0.58,5.32,2.15,5.32,2.15l5.87,2.68l5.57,2.71c0,0,3.56,1.78,5.17,3.05   c1.61,1.27,4.28,1.87,7.67,1.85c3.38-0.02,6.01-0.86,7.08,0.06c1.08,0.92-0.38,3.94-1.19,7.15c-0.81,3.2-1.2,5.05-1.27,5.68   c-0.07,0.62-0.42,2.22,0.29,3.64s6.15,7.93,6.15,7.93l8.17,8.2l8.23,8.23c0,0,6.69,3.67,12.69,2.92c6-0.74,12.56-4.59,12.56-4.59   s2.48-1.14,3.46-1.2L975.02,563.42z"
	}, { 
		_id: "_path_13", path: "M618.85,607.91c0,0-2-5-8-8s-3-8-2-10s7-8,7-10s-1-10,1-12s4-8,8-7s7,1,9,2s5-2,6-5s3-5,5-7s2.29-2,4.65,0   c2.35,2,4.6,8.85,6.98,11.42s1.26,4.29,6.82,3.43c5.56-0.86,1.56-1.86,5.56-0.86s9,1,9,4s0,5,3,8s8,5,9,9s2.15,5.56,1.08,8.78   c-1.08,3.22-1.01,4.53-4.04,5.38c0,0-2.51,8.12-2.77,9.48s-1.03,5.57-1.15,9.47s-1.12,7.9-1.12,7.9s-7.21,0-8.61,0   c-1.39,0-13.72-0.79-15.56-0.39c-1.84,0.39-8.14-0.43-10.99-0.52c-2.85-0.09-5.26-0.65-7.55,2.13c-2.29,2.78-5.82,4.63-7.56,5.71   s-6.46,0.38-6.46,0.38s0.72-2.31-0.28-4.31s-3-7-4-8s-1-4-1-6S618.85,607.91,618.85,607.91z"
	}, { 
		_id: "_path_14", path: "M588.52,659.92c0,0-3,0-3,3s-1.02,10.02-6.01,11.51s-6.34,2.04-15.17,0.77s-6.83-1.28-8.83,1.72s-3,10-5,12   s-1.63,5.81-7.31,11.41c-5.69,5.59-6.85,4.03-8.27,4.31s-6.42,1.28-8.42,3.28s-4,4-7,5s-3-3-6-2c-3,1-3,4-5,4s-4.29-1.32-6.15-1.66   c-1.85-0.34-8.46,2.08-10.16-2.63c-1.7-4.71-3.43-8.79-2.56-18.25c0.87-9.46,2.35-16.01,1.61-19.74c-0.74-3.72-1.74-6.72-1.74-6.72   s-4.91-2.24-5.45-3.12c-0.55-0.88-6.55-3.88-6.55-3.88s-1-8-3-8s4,0,4,0s-2.62-9.2,3.19-11.1c5.81-1.9,16.81-4.9,22.81-12.9   c0,0,4.05-3.82,10.03-0.41c5.97,3.41,8.28,0.37,10.13-0.11c1.85-0.48,9.78-2.64,19.32-2.06c9.53,0.58,10.43,1.49,11.48,2.53   c1.05,1.04,1.05,6.04,1.05,6.04h5c0,0,1.73-3.92,3.87-3.46c2.13,0.46,7.13,2.46,7.13,2.46s0.64,1.03,3.82,1.02   s14.18-0.02,14.18-0.02s5,2,5,4s1,6,1,6l-2,15C594.52,657.92,591.52,660.92,588.52,659.92z"
	}, { 
		_id: "_path_15", path: "M590.52,632.92c0,0,5,2,5,4s1,6,1,6s0.79,0,3.9,0c3.1,0,9.84,1,10.97,0c1.13-1,4.13-1,4.13-1s1-6,5-7   s3.63-0.52,4.61-0.71c0.98-0.18,1.25-2.34-2.68-8.81s-2.93-9.48-2.93-9.48s1.43-8.07-5.28-13.54c-6.72-5.46-4.72-2.46-6.72-5.46   s0-7,0-7s0.1-4.6-8.45-9.8c0,0-2.81-1.2-3.68-1.2c-0.87,0-4.87,1.2-4.87,2.6s1,1.4,0,4.4s0.78,4.2-1.11,5.1   c-1.89,0.9-13.89,0.9-13.89,0.9s-14,1-17-3s-4.73-8.08-4.73-8.08s-1.11-3.23-3.19-4.58s-9.56-5.25-9.32-5.29s-2.76-2.05-2.76-2.05   s-1.11-1.73-3.56-1.36c-2.44,0.36-4.44,1.36-6.44,0.36s-2.25-0.17-3.13-1.58c-0.87-1.42-2.57-4.34-2.72-5.88   c-0.15-1.54,0.85-7.54,0.85-7.54s0.89-2.71-4.56-3.36c0,0-6.99-1.61-6.72-1.63c0.27-0.02-8.73-1.02-11.73-2.02s-4.2-1-6.1,0   c-1.9,1-4.98,1.69-4.98,1.69s-6.92,0.31-6.92,1.31s-0.09,5.59-0.54,6.29c-0.46,0.71-0.46,0.71-1.46,1.71s-7,3-7,3   s-7.95,2.96-11.48,1.98c-3.52-0.98-4.14-0.98-5.33-2.98c-1.19-2-5.19-3-7.19-3s-3.53,2.66-4.27,3.33   c-0.73,0.67-3.73,3.67-3.73,3.67s-4.4,7.62-9.7,11.81c-5.3,4.19-5.22,14.02-5.26,20.61c-0.04,6.59-1.04,30.59-1.04,30.59   s-8.97-0.3-14.99,9.35c0,0-4.45,7.61-4.73,19.13c0,0-0.38,4.54,1.17,7.53c1.55,2.99,5.8,5.15,5.67,5.07   c-0.12-0.08,4.53,2.8,7.2,2.86s11.23,1.32,14.45,0.69s2.96-2.78,4.59-5.21c1.63-2.42,8.63-11.42,8.63-11.42s3.87,3.86,9.43,3.93   c5.57,0.07,5.57,0.07,5.57,0.07s0.13-2.43,1.07-3.22c0.93-0.78,4.5-3.45,4.72-3.12c0.21,0.33,6.21-0.67,6.21-0.67h4c0,0-1-8,1-10   s20-5,25-14c0,0,4-4,13,1c0,0,3,1,9-2s27-1,27-1s3,2,3,5s0,3,0,3s3,1,5,0s3-5,6-3s3,0,5,2S590.52,632.92,590.52,632.92z"
	}, { 
		_id: "_path_16", path: "M410.32,449.51c0,0-10.22-0.93-19.01,0.24c-8.79,1.17-2.97,4.91-0.88,5.54c2.09,0.63,11.62,8.94,13.86,11.78   c2.23,2.85,8.75,3.75,12.49,11.8c3.74,8.05,5.74,7.05,4.74,10.05s-3.33,19.59-3.67,21.8c-0.33,2.2-1.84,8.77-1.09,12.49   c0.75,3.72,10.75,2.72,9.75,3.72s5.26,0.77,7.13,6.89s4.67,6.88,5.77,8c1.1,1.12,5.1,7.12,4.1,12.12c0,0,0.43,5.36-2.29,9.18   c-2.71,3.82,6.29-7.18,8.29-7.18s4-1,6,1s1,5,4,5s12,0,14-2s6-1,7-2s-3,1,0-1s2-7,2-8s1-1,2-1s5,0,8-1s3-2,8-1s13,2,16,3s7,1,7,4   s-2,7,0,10s1,4,5,5s7-2,10,1s13,7,14,9s3,8,6,11s13,3,17,3s12,0,12,0c3,0,2-3,3-6s-2-4,2-6s5-1,9,2s7,8,7,8l7-10c0,0-1-7.12,0-9.56   s4.57-8.89,5.78-8.67c1.22,0.23,0.22-0.77,3.22-0.77s6,1,6,1s-0.92-4.37-1.46-6.18c-0.54-1.82-1.38-3.36-2.46-4.59   c-1.08-1.23-7.34-6.96-8.21-7.59c-0.87-0.63-4.62-4.03-10.24,0.67s-14.23,12.79-14.23,12.79s-4.39,4.91-7.39,0.91l-1-6   c0,0-15,2-18,1s-4-6-4-6v-13c0,0,1-2,4-5s-0.11-8.86-0.06-9.43c0.06-0.57-3.94-6.57-4.94-8.57c-1-2-0.13-9.58-1.57-13.29   c-1.43-3.71-1.25-5.61-4.34-7.66s-4.58-3.56-12.33-5.3c-7.76-1.75-12.18-3.14-12.18-3.14s-3.54-1.48-5.56-2.54   c-2.02-1.07-4.55-0.45-5.78-0.76s-5.28-0.71-5.28-0.71s-3.35,0.24-5.15,0.32c-1.8,0.08-4.8-0.92-6.8-0.92s-6.17,4.51-7.59,5.75   s-4.99,4.26-6.2,0.25c-1.21-4.01-2.04-6.21-2.04-6.21l-0.17-1.8c0,0-1-1-3,3s0,4-7,5c0,0-5.21,0.28-6.11-2.36   c-0.89-2.64-0.66-6.62-2.28-7.13s-2.36-1.88-8.99-1.19c-6.63,0.69-15.83,2.66-18.23,1.17c0,0-4.77-0.02-7.59-4.25   c-2.82-4.23-7.59-5.93-7.59-5.93s-1.22-0.3-2.22-3.3s-5-8-5-8s-6-2-7-2S410.32,449.51,410.32,449.51z"
	}, { 
		_id: "_path_17", path: "M615.52,541.92c0,0,6,3,8,6s5,4,5,6s2,3,2,6s0,2.04,0,2.04s3.12,1.29,3.56,1.13c0.44-0.17,1.83,0.15,3.63-2.01   c1.81-2.16,2.29-4.64,2.55-4.9c0.26-0.26,1.05-2.02,3.15-4.14c2.11-2.12,2.49-3.12,3.3-2.62c0,0-1.12-1.42-1.16-4.96   c-0.03-3.54-0.26-3.89-1.15-6.21c-0.88-2.33-3.34-4.46-3.61-7.89s-2.68-9.43-2.68-9.43l-4.59-7l-9.63-23.21   c0,0-3.58-10.52-3.47-14.65c0.11-4.14-1.22-5.37-1.22-5.37l-4.68-3.76c0,0-2.11,0.59-5.56-0.21c-3.44-0.79-7.32-1.6-8.38-1.2   c-1.06,0.41-11.13-0.39-11.13-0.39s-3.94-0.2-5.94-1.2s-7.32-6.6-8.16-8.3c-0.84-1.7-1.08-3.68-2.46-5.69   c-1.38-2.01-3.91-3.75-6.14-4.38c-2.24-0.63-2.9-1.86-11.07-3.24c-8.17-1.39-10.92-5.69-11.55-7.04s-2.23-4.49-5.93-4.42   c0,0-7.34-1.23-7.02-1.08c0.32,0.15-9.32-1.63-9.32-1.63s-4.98-2.11-5.17-2.17c-0.19-0.05-9.19,1.95-15.19,8.95   s-7.81,11.91-11.41,11.45c-3.59-0.45-16.02-6.45-18.31-6.95c-2.29-0.5-9.42-4.49-13.35-4.49c-3.94-0.01-14.94-0.01-16.94,0.99   s-4.21,7.36-8.6,10.68c-4.4,3.32-7.31,5.27-11.85,3.79c-4.54-1.48-1.54,1.52-1.54,1.52s4,4,5,8s3,3,5,5s5,4,7,6s7,3,9,3s17-2,17-2   s7-1,8,4s0,7,7,7s6-3,7-5s3-4,3-3s0,2,1,4s1,7,4,6s9-8,11-8s6,1,8,1c2,0,5-1,8,0s6,0,9,2s12,4,17,5s13,4,15,11s1,13,2,15   c1,2,6,9,6,12s0,4-1,6s-3,2-4,5s0,12,0,13s2,5,4,6s18-1,18-1l1,6c0,0,2,3,5,1s12-11,12-11S610.52,540.92,615.52,541.92z"
	}, { 
		_id: "_path_18", path: "M598.52,244.92c0,0,3-4,6-2s2,8,2,8s6,10,6,12s0,8,0,8s4,5,2,8s-8,9-10,20s4,12,4,12s12,1,13,5s-2,17,0,21   c0,0,9,8,10,9s1,5-2,5s-7-2-8,0s3,7,3,7s2,2,2,8s1,7,6,6s0,20,0,20s-4-3-5,0s2,16,1,20s-7,13-14,13s-8,1-7,5s5,13,5,13s-1,4,0,7   s6,7,7,8s-2,6-3,8s-7,1-12,0s-18,0-21-2s-8-7-9-10s-1-5-7-8s-8-2-16-5s-7-7-10-9s-17.76-2.19-23-5c-5.24-2.81,1.97,1.45,7.98-4.27   c6.02-5.73,9.02-6.73,11.02-18.73s7-11,12-16s10-6,8-14c0,0-11-8-8-18s6.55-17.03,9.78-21.51c3.22-4.49,8.31-20.65,8.31-20.65   s4.17-10.55,3.54-21.69c-0.63-11.14-4.39-21.9-3.51-28.02c0.88-6.12-0.8-14.09,10.04-14.61c10.84-0.52,15.84-2.52,15.84-2.52   L598.52,244.92z"
	}, { 
		_id: "_path_19", path: "M626.52,365.92c0,0-1.5,7.56,4.25,6.28c5.75-1.28,3.97,8.88,3.97,8.88l-2.08,10.15l6,2.18   c0,0,12.86,4.51,17.86,8.51c0,0,13,1,18,4s7.95,5.7,7.47,5.35c0,0,18.53-13.35,22.53-15.35s9-6,12-6s7,3,9,8s6,5,9,5s11,0,13,2   s6,2,6,2s6.17-19.13,5.08-25.56c-1.08-6.44-9.08-6.44-9.08-6.44s-9.91-12.8-13.96-13.9c-4.04-1.1-4.27-0.57-5.66-2.33   s2.47-1.47,1.54-4.61c-0.93-3.15-0.59-4.69-6.76-8.92c0,0-3.73-0.86-7.95-2.54c-4.22-1.68-8.22-13.68-10.22-24.68c0,0-1-8-14-19   l-8-10c0,0-4-20-12-28c0,0,9-9,9-15s-3-15-9-19s-12-2-16-2s-17.56-5-21.78-6.5s-10.22,1.5-8.22,8.5c0,0-2.93,5.15-14.97,8.07   c-12.03,2.93-11.03,4.93-7.03,6.93s2,9,2,9s6,8,6,12s0,8,0,8s5,4,2,8s-10,15-10,20s-2,8,4,12c0,0,7.69-0.13,10.35,2.43   c2.65,2.57,4.34,0.43,2,20.5l0.66,3.07c0,0,8,7,10,9s0,5-2,5s-5.99-0.88-5.99-0.88s-4.76,0.48-0.38,5.68"
	}
]};

var KS_SVG_Initialize = function(){ "use strict";
	//- 
	this.scene;
	this.camera;
	this.renderer;
	this.controls;
	
	this.GId = '';
	this.container;	
	this.parentCont;
	this.Tweens = [];
	this.tagConts = {};
	this.Result = false;
	//-
	this.WHRatio;
	this.svgOffset;
	
	this.mapObject;
	this.shapesArr = [];
	this.mEventArr = [];
	this.shapesArrLen = 0;
	//-
	this.SVGMapData;
	this.SVGMapObj = {};
	
	this.HeatMapObj;
	this.coordTrans;
	
	//-init
	this.init = function ( cts, config, df_SVGData ) {
		var conts = parseCts(cts);
		if ( detector() && conts != null) {
			try {
				config = config || {};
                df_Config = $.extend( true, {}, default_Config, config );
                // console.log('df_Config-----',df_Config);
				
				df_SVGData = df_SVGData || _SVGData;
				thm.SVGMapData = $.extend( true, {}, df_SVGData );
				
				thm.parentCont = conts;
				thm.GId += THREE.Math.generateUUID();
				var TId = conts.attr('id') +'_'+thm.GId;
				thm.container = creatContainer( TId );
				thm.parentCont.html( thm.container );
				_Collects.loadTexture();
				__setPlugsIN();
				
				initiate();
				is_Init = true;
			} catch (e) {
				thm.Result = 'error! Initialization Error!';
				creatError(conts);
				return;
			}
		} else thm.Result = 'error! Not Support WebGL!';
	};
	
	this.render = function ( func ) {
		if ( is_Init ) { renderers( func ); }
	};
	
	this.disposeRender = function () {
		if( is_Init && testing() ) {
			removeEvent();
			thm.controls.dispose();
			thm.container.remove();
			thm.renderer.forceContextLoss();
			thm.renderer.domElement = null;
			thm.renderer.context = null;			
			thm.renderer = null;
			is_Init = false;
		}
	};
	
	//-
	this.setSVGMap = function ( data, opt ) {
		if( is_Init && thm.shapesArrLen <= 0 ) {
			init3DMesh( data || {} );
			opt && thm._setAdmissionDynamic( opt );
		}
	};
	
	this.setHeatMap = function ( data, radius ) {
		if( is_Init ) {
			thm._setCoordTrans();
			setHeatMap( data, radius );
		}
	};
	
	this._setCoordTrans = function( jwOpts, xyOpts ) {
		// jwOpts = jwOpts || [ [121.149972,31.29433], [121.088385,31.441649], [120.824031,31.509372] ];
		// xyOpts = xyOpts || [ [539,460], [436,195], [60,101] ];
		jwOpts = jwOpts || [ [121.149972,31.29433], [121.088385,31.441649], [120.824031,31.509372] ];
		xyOpts = xyOpts || [ [539,460], [436,195], [60,101] ];
			
		thm.coordTrans = new _CoordTrans();
		thm.coordTrans.init( jwOpts, xyOpts );
	}
	
	//-
	this.onMouseDownEvent = function ( func ) {
		df_MouseDownCallback = toFunction( func );
	};
	
	//-
	this._setAdmissionDynamic = function ( opt ) {
		if( is_Init ) {
			opt = opt || {};
			df_AdmisDic = $.extend( true, {}, default_AdmissionDynamic, opt );
			df_AdmisDic.type = _Collects.limit( df_AdmisDic.type*1, [0, 1, 2] );
			df_AdmisDic.perTime = _Collects.clamp( df_AdmisDic.perTime*1, 0.1, 5, 2 );
			df_AdmisDic._transTimes = ( df_AdmisDic.type && -1 ) || ( !df_AdmisDic.type && 0 );
		}
	};
	
	//-
	var thm = this;
	var df_Raycaster, df_Mouse, df_MouseEvent = false, df_Intersects, df_ItdMesh, df_ItdMesh2;   //tips & event
	var df_Clock, df_Width = 0, df_Height = 0, is_Init = false, df_LableMtl, _MDown = 1, 
		df_pointMtl, df_pointMtl2, df_txueLoader;   //essential
	
	//- callback
	var df_MouseDownCallback = toFunction();
	
	//- AdmissionDynamic
	var df_AdmisDic = {};
	var default_AdmissionDynamic = { type: 0, perTime: 5, _transTimes: -1, };
	
	//- 
	var df_onAnim = false;
	var df_tAnim = {
		id: 0,
		type: 0,
		perTime: 1.5,
		transTimes: 0,
		WHRatio: null,
		svgOffset: null
	};
	
	//- default setting
	var df_Config = {};
	var	default_Config = {
		tags: {
			fontColor: "RGBA(207,230,255,.9)",
			fontHover: "RGBA(91,170,255,.9)",
			fontSize: 5,
		},
		sceneStyle: {
			blockColor: "rgba(0,241,250,0.9)",
			highLightColor: "RGBA(40,108,216,.6)",
			borderColor: "RGBA(72,102,239,1)",
			borderWidth: 2,
		},
		texture: { 
            df_p1: '',
            df_l1: '',
            p2: ''
			// df_p1: '',
			// df_l1: '',
			// p2: '', 
		},
		outerGlow: {
			glowColor: "#f5f8fd",
			size: 1.3,
			perTime: 1,
		},
		controls: {
			enablePan: false, enableZoom: false, enableRotate: true,
			
			enableDamping: true, dampingFactor: .1, panSpeed: .1, zoomSpeed: .1, rotateSpeed: 0.013,
			distance: [256, 512], polarAngle: [0, Math.PI*.23], azimuthAngle: [-Math.PI*.5, Math.PI*.5],
		},
		
		background: { color: '#ffffff', opacity: 0 },
		camera: { fov: 45, near: 16, far: 10000, position: [0, 98, 512] },
		light: {
			Ambient: { color: '#FFFFFF', strength: 1.0 }, isHemisphere: false, isDirectional: true,
			hemisphere: { color: '#EFEFEF', groundColor: '#EFEFEF', strength: 0.7, position: [0, 0, 200] },
			directional: { color: '#1A1A1A', strength: 1.0, position: [75, 100, 75] },
		}
	};
	
	//-init
	function initiate () {
		
		thm.WHRatio = new THREE.Vector3(1, 1, 1);
		thm.svgOffset = new THREE.Vector3(0, 0, 0);
		
		thm.scene = new THREE.Scene();
		df_Clock = new THREE.Clock();
		
		var wh = getWH(); df_Width = wh.w; df_Height = wh.h;
		var cm = df_Config.camera, bg = df_Config.background;
		
		thm.camera = new THREE.PerspectiveCamera( cm.fov, wh.w/wh.h, cm.near, cm.far );
		thm.camera.position.set( cm.position[0], cm.position[2], cm.position[1] );
		thm.camera._position = thm.camera.position.clone();
		
		// renderer
		thm.renderer = new THREE.WebGLRenderer({ antialias:true, alpha:true });
		thm.renderer.setPixelRatio( Math.min(1, window.devicePixelRatio) );
		thm.renderer.setSize( df_Width, df_Height );		
		thm.renderer.setClearColor( bg.color, bg.opacity );
		
		// controls
		_Collects.handleControls();
		thm.controls = new THREE.OrbitControls( thm.camera, thm.container[0] );
		setControls( thm.controls, df_Config.controls, true );
		
		// lights
		setLight( thm.scene, df_Config.light );
		
		thm.container.append( $(thm.renderer.domElement) );
		window.addEventListener('resize', onContResize, false);
		
		// mouse event
		df_Mouse = new THREE.Vector2();
		df_Raycaster = new THREE.Raycaster();
		thm.container[0].addEventListener( 'mouseup', onDocumentMouseUp, false );
		thm.container[0].addEventListener( 'wheel', onDocumentMouseWheel, false );
		thm.container[0].addEventListener( 'mouseout', onDocumentMouseOut, false );
		thm.container[0].addEventListener( 'mousemove', onDocumentMouseMove, false );
		thm.container[0].addEventListener( 'mousedown', onDocumentMouseDown, false );
	}
	
	//-shader
	var _Shaders = {
		SplineVShader: [
			"uniform vec3 u_color; uniform float u_opacity; uniform float u_width;",
			"attribute float cRatio; attribute vec3 cPosition; varying vec4 vColor; ",
			" varying vec2 vUv; void main() { ",
				"vec3 nPosition = position; float k = 20.0;",
				"if ( cRatio>.0 && cRatio<.5 ) { nPosition.y = u_width; } ",
				"if ( cRatio>.5 && cRatio<1.5 ) { nPosition = cPosition*u_width+position; } ",
				// 2
				"if ( cRatio>1.5 && cRatio<2.5 ) { nPosition = -cPosition*k+position; } ",
				"if ( cRatio>-2.5 && cRatio<-1.5 ) { nPosition = cPosition*k+position; } ",
				// 3
				"if ( cRatio>2.5 && cRatio<3.5 ) { ",
					"nPosition = -cPosition*k+position; nPosition.y = u_width/2.0; } ",
				"if ( cRatio>-3.5 && cRatio<-2.5 ) { ",
					"nPosition = cPosition*k+position; nPosition.y = -u_width/2.0; } ",
				// 4
				"if ( cRatio>3.5 && cRatio<4.5 ) { ",
					"nPosition = -cPosition*k+position; nPosition.y = -u_width/2.0; } ",
				"if ( cRatio>-4.5 && cRatio<-3.5 ) { ",
					"nPosition = cPosition*k+position; nPosition.y = u_width/2.0; } ",
				
				"vColor = vec4( u_color, u_opacity ); vUv = uv;",
				"vec4 mP = modelViewMatrix * vec4( nPosition, 1.0 ); ",
				"gl_Position = projectionMatrix * mP; } "
		].join("\n"),
		SpreadVShader: [
			'uniform vec3 u_color; uniform float u_opacity; uniform float u_time; ',
			'attribute float cRatio; attribute vec3 position2; varying vec4 vColor; ',
			'varying vec2 vUv; void main() {',
				'float _k = cRatio + u_time; ',
				'if ( _k >= 1.0 ) _k -= 1.0; ',
				'vec3 vPos = mix( position, position2, _k );',
				'vColor = vec4( u_color, u_opacity*5.0*(1.0-_k) ); vUv = uv;',
				'gl_Position = projectionMatrix * modelViewMatrix * vec4( vPos, 1.0 );',
			'}'	
		].join("\n"),
		SpotVShader: [
			'uniform vec3 u_color; uniform float u_opacity; uniform float u_size; ',
			'uniform float u_time; attribute float cOffset; varying float vTime; ', 
			'varying vec4 vColor; void main() { vTime = u_time + cOffset; ',
				'vColor = vec4( u_color, u_opacity ); ',
				'vec4 mP = modelViewMatrix * vec4( position, 1.0 ); ',
				'gl_PointSize = u_size * 300.0/(-mP.z ); ', 
				'gl_Position = projectionMatrix * mP; } ',
		].join("\n"),
		
		SplineFShader: [
			"varying vec4 vColor; void main() {  gl_FragColor = vColor; } ",
		].join("\n"),
		SpreadFShader: [
			"uniform sampler2D u_txue; varying vec4 vColor; ",
			"varying vec2 vUv; void main() {  gl_FragColor = vColor * texture2D(u_txue, vUv); } ",
		].join("\n"),
		SpotFShader: [
			"uniform sampler2D u_txue; varying float vTime; varying vec4 vColor; ", 			
			"const float pi2 = 6.2831853071795866; void main() { ",
				"float c = cos( vTime * pi2 ); float s = sin( vTime * pi2 ); ",
				"vec2 rotatedUV = vec2( c*(gl_PointCoord.x-.5) + s*(gl_PointCoord.y-.5) + .5,", 
									  " .5 -c*(gl_PointCoord.y-.5) + s*(gl_PointCoord.x-.5) );",
				
				"gl_FragColor = vColor * texture2D( u_txue, rotatedUV ); } ",
		].join("\n"),
	};
	
	//- Common methods
	var _Collects = {
		obj: function () { return new THREE.Object3D(); },
		color: function ( c ) { return new THREE.Color(c); },
		setMulti: function ( arr ) { return new THREE.MultiMaterial( arr ); },
		
		//-	
		creatCGeo: function ( p ) { return new THREE.CurvePath().createGeometry( p ) },
		tgShape: function ( c, h ) { return THREE.ShapeUtils.triangulateShape( c, h ); },
		Matrix: function () { return new THREE.Matrix4().makeRotationX( _Tdata.M_PI2 ); },
		reverse: function ( c ) { if ( !THREE.ShapeUtils.isClockWise( c ) ) c = c.reverse(); },
		clamp: function ( v, mi, ma, df ) { return Math.min( ma, Math.max( mi, isNaN(v)?df: v ) ); },
		limit: function ( v, arr ) { return (arr.indexOf(v) != -1)? v: arr[0]; },
		
		//- easing
		easing: function ( k, func ) { if ( isFunction( func ) ) return func( k ); else return k; },
		ease1: function ( k ) { k *= 2; return (k>1)? 0.5*k*(k-2)+1: 0.5*k*(2-k); },
		ease2: function ( k ) { k *= 2; return 0.5 * ( --k * k * k + 1 ); },
		ease3: function ( k ) { return k * (2 - k); },
		
		//- opacity traverse 
		opacityTvs: function ( obj, val ) {
			val = isNaN(val*1)? 1: val*1;
			obj.traverse( function( child ) {
				if ( child.material && child._opacity  ) {
					if ( !child.material.uniforms ) child.material.opacity = child._opacity * val;
					else child.material.uniforms.u_opacity.value = child._opacity * val;
				}
			});
		},
		
		colorTvs: function ( obj, isHL ) {
			obj.traverse( function( child ) {
				if ( child.material && child._hlColor ) {
					var _c = isHL? child._hlColor: child._color,
						_p = isHL? child._hlOpacity: child._opacity;
					
					if ( !child.material.uniforms ) {
						child.material.color = _c;
						child.material.opacity = _p;
					} else {
						child.material.uniforms.u_color.value = _c;
						child.material.uniforms.u_opacity.value = _p;
					}
				}
			});
		},
	
		//- preprocessing
		handleTags: function () {
			var fs = df_Config.tags.fontSize*1;
			
			df_Config.tags.fontColor = _Collects.getColorArr( df_Config.tags.fontColor );
			df_Config.tags.fontHover = _Collects.getColorArr( df_Config.tags.fontHover );
			df_Config.tags.fontSize = _Collects.clamp( fs, 1, 10, 3 );
			df_Config.tags.fontWeight = ( df_Config.tags.fontWeight==2 )? 2: 1;
		},
		
		handleTagsText: function ( id, name, coord ) {
			for ( var i=thm.shapesArrLen-1; i>=0; i-- ) {
				var shi = thm.shapesArr[i];
				if ( shi._path_id == id ) {
					var shiC0 = shi.children[0],
						shiC0T = shiC0.children[3];
						
					var _txue = _Collects.creatTagsTxue( name ),
						_s = _t._scale * df_Config.tags.fontSize;
					
					thm.SVGMapObj[id]['name'] = name;
					thm.SVGMapObj[id]['coord'] = coord;
					shi._name = shiC0._name = name;
					
					shiC0T.material.size = _s;
					shiC0T.material.map = _txue;
				}
			}
		},
		
		handleControls: function () {
			df_Config.controls.enablePan = ( df_Config.controls.enablePan === true );
			df_Config.controls.enableZoom = ( df_Config.controls.enableZoom === true );
			df_Config.controls.enableRotate = ( df_Config.controls.enableRotate === true );
		},
		
		handleBlock: function () {
			var bc = df_Config.sceneStyle.blockColor,
				hlc = df_Config.sceneStyle.highLightColor;
			
			df_Config.sceneStyle.blockColor = _Collects.getColorArr( bc );
			df_Config.sceneStyle.highLightColor = _Collects.getColorArr( hlc );
		},
		
		handleBorder: function () {
			var	lc = df_Config.sceneStyle.borderColor,
				lw = df_Config.sceneStyle.borderWidth*1;
			
			df_Config.sceneStyle.borderColor = _Collects.getColorArr( lc );
			df_Config.sceneStyle.borderWidth = _Collects.clamp( lw, .1, 5, 1 );
		},
		
		handleGlow: function () {
			df_Config.outerGlow.glowColor = _Collects.getColorArr( df_Config.outerGlow.glowColor );
			
			df_Config.outerGlow.size = _Collects.clamp( df_Config.outerGlow.size*1, .1, 5, 1 );
			df_Config.outerGlow.perTime =  _Collects.clamp( df_Config.outerGlow.perTime*1, .1, 5, 2 );
		},
		
		//- creatMapMesh
		getBevelVec: function ( inPt, inPrev, inNext ) {
			var v_trans_x, v_trans_y, shrink_by = 1;
			
			var v_prev_x = inPt.x - inPrev.x, v_prev_y = inPt.y - inPrev.y,
				v_next_x = inNext.x - inPt.x, v_next_y = inNext.y - inPt.y,			
				v_prev_lensq = ( v_prev_x * v_prev_x + v_prev_y * v_prev_y ),		
				collinear0 = ( v_prev_x * v_next_y - v_prev_y * v_next_x );

			if ( Math.abs( collinear0 ) > Number.EPSILON ) {
				var v_prev_len = Math.sqrt( v_prev_lensq );
				var v_next_len = Math.sqrt( v_next_x * v_next_x + v_next_y * v_next_y );

				var ptPrevShift_x = ( inPrev.x - v_prev_y / v_prev_len ),
					ptPrevShift_y = ( inPrev.y + v_prev_x / v_prev_len ),
					ptNextShift_x = ( inNext.x - v_next_y / v_next_len ),
					ptNextShift_y = ( inNext.y + v_next_x / v_next_len );

				var sf = ( ( ptNextShift_x-ptPrevShift_x )*v_next_y - 
					( ptNextShift_y-ptPrevShift_y )*v_next_x ) / ( v_prev_x*v_next_y - v_prev_y*v_next_x );

				v_trans_x = ( ptPrevShift_x + v_prev_x * sf - inPt.x );
				v_trans_y = ( ptPrevShift_y + v_prev_y * sf - inPt.y );

				var v_trans_lensq = ( v_trans_x * v_trans_x + v_trans_y * v_trans_y );
				
				if ( v_trans_lensq <= 2 ) { return	new THREE.Vector2( v_trans_x, v_trans_y );
				} else { shrink_by = Math.sqrt( v_trans_lensq / 2 ); }

			} else {

				var direction_eq = false;
				if ( v_prev_x > Number.EPSILON ) {
					if ( v_next_x > Number.EPSILON ) direction_eq = true;
				} else {
					if ( v_prev_x < - Number.EPSILON ) {
						if ( v_next_x < - Number.EPSILON ) direction_eq = true;
					} else {
						if ( Math.sign(v_prev_y) === Math.sign(v_next_y) ) direction_eq = true;
					}
				}

				if ( direction_eq ) {
					v_trans_x = - v_prev_y;
					v_trans_y =  v_prev_x;
					shrink_by = Math.sqrt( v_prev_lensq );
				} else {
					v_trans_x = v_prev_x;
					v_trans_y = v_prev_y;
					shrink_by = Math.sqrt( v_prev_lensq / 2 );
				}
			}

			return new THREE.Vector2( v_trans_x / shrink_by, v_trans_y / shrink_by );
		},
		
		creatSplineGeo: function ( contour, opts ) {
			opts = opts || {};
			contour = contour || [];
			var type = opts.type || 0,
				
				u1 = (undefined != opts.uRatio)? opts.uRatio: .4,
				v1 = (undefined != opts.vRatio)? opts.vRatio: 1;
			
			var bgeo = _Geometries.buf();			
			_Collects.reverse( contour );
			
			var il = contour.length, bevelVecs = [],
				r1 = -.1, r2 = .1, v2 = 1-v1, u2 = 1-2*u1;
			
			if ( type > 0.5 ) {
				for ( var i=0, j=il-2, k=i+1; i<il; i++, j++, k++ ) {
					if ( j === il ) j = 0;
					if ( k === il ) k = 0;
					bevelVecs[i] = _Collects.getBevelVec( contour[i], contour[j], contour[k] );
				}
				r1 = -type; r2 = type;
			}
			
			var	indices = [], uvs = [], ratios = [],
				positions = [], positions2 = [];
			
			for ( var i=0; i<il; i++ ) {
				var ci = contour[i], bv = bevelVecs[i] || new THREE.Vector2();
				bv = bv.clone();
				
				uvs.push( u1+u2*i/il, v1, u1+u2*i/il, v2 );
				positions.push( ci.x, ci.y, 0, ci.x, ci.y, 0 );
				positions2.push( bv.x, 0, bv.y, bv.x, 0, bv.y );
				
				ratios.push( r1, r2 );
				
				if ( i < il-1 ) {
					var a = i*2, b = i*2+1, c = i*2+2, d = i*2+3;
					indices.push( a, b, c, b, d, c );
				}
			}			
			indices.push( il*2-2,il*2-1, 0, il*2-1, 1, 0 );
			
			bgeo.setIndex( indices );
			bgeo.addAttribute( 'uv', new THREE.Float32BufferAttribute( uvs, 2 ) );
			bgeo.addAttribute( 'cRatio', new THREE.Float32BufferAttribute( ratios, 1 ) );
			bgeo.addAttribute( 'position', new THREE.Float32BufferAttribute( positions, 3 ) );
			bgeo.addAttribute( 'cPosition', new THREE.Float32BufferAttribute( positions2, 3 ) );
			
			return bgeo;
		},
		
		creatShapeGeo: function ( contour ) {
			contour = contour || [];
			var sgeo = _Geometries.buf();
			var i, l, indices = [], vertices = [], uvs = [];
			
			_Collects.reverse( contour );
			var faces = _Collects.tgShape( contour, [] );
			
			for ( i=0, l=contour.length; i<l; i++ ) {
				var vertex = contour[i];
				vertices.push( vertex.x, vertex.y, 0 );
				uvs.push( vertex.x, vertex.y );
			}
			
			for ( i=0, l=faces.length; i<l; i++ ) {
				var face = faces[ i ];
				indices.push( face[0], face[1], face[2] );
			}
			
			sgeo.setIndex( indices );
			sgeo.addAttribute( 'uv', new THREE.Float32BufferAttribute( uvs, 2 ) );
			sgeo.addAttribute( 'position', new THREE.Float32BufferAttribute( vertices, 3 ) );
			
			return _Geometries.geo().fromBufferGeometry( sgeo );
		},
		
		creatOuterGlow1: function ( shapes, opts ) {
			var sl = shapes.getLength();
			
			var num = _Collects.clamp( Math.floor( sl/_Tdata.st ), 2, 9, 2 ) ,
				_k = _Tdata.st*.7, len2 = num * _k - 1;
			
			var contour = shapes.getSpacedPoints( len2 );
			_Collects.reverse( contour );
			var testGeo = _Collects.creatCGeo( contour );
			testGeo.applyMatrix( _Collects.Matrix() );
			var vecs = testGeo.vertices, gGeo1 = _Geometries.geo();
			for ( var i=0; i<num; i++ ) { gGeo1.vertices.push( vecs[i*_k] ); }
			
			var	outerGlow = new THREE.Points( gGeo1, _Materials.point({ 
				color: opts.gc[0], opacity: opts.gc[1]*1.2, size: 40*opts.gs, depthTest: false,
				transparent: true, map: _Tdata.txues._df_p1, blending: THREE.AdditiveBlending,
			}) );
			
			outerGlow.position.y = .2;
			
			outerGlow._isGlow = true;
			outerGlow._phy = outerGlow.position.y;
			outerGlow._color = opts.gc[0];
			outerGlow._opacity = opts.gc[1]*1.2;
			
			//-
			outerGlow._flicker = true;
			outerGlow._transTimes = 0;
			outerGlow._perTimes = opts.gp;
			outerGlow._ratio = Math.random();
			
			return outerGlow;
		},
		
		creatOuterGlow: function ( shapes, opts ) {
			var sl = shapes.getLength(), len2 = sl/_Tdata.sl; 
			var num = _Collects.clamp( Math.floor( sl/_Tdata.st ), 0, 5, 4 );
			
			if ( num < 1 ) { return _Collects.obj(); }
			
			//-
			var _o = 1.4, _o2 = .4;
			if ( !df_pointMtl ) {
				df_pointMtl = _Materials.point({ 
					color: opts.gc[0], opacity: opts.gc[1]*_o, size: 90*opts.gs, depthWrite: false,
					transparent: true, map: _Tdata.txues._df_l1, blending: THREE.AdditiveBlending,
				});
			}
			if ( !df_pointMtl2 ) {
				df_pointMtl2 = _Materials.point({ 
					color: opts.gc[0], opacity: opts.gc[1]*_o2, size: 15*opts.gs, depthWrite: false,
					transparent: true, map: _Tdata.txues._spot, blending: THREE.AdditiveBlending,
				});
			}
			
			//-
			var contour = shapes.getSpacedPoints( len2 );
			var gGeo3 = _Collects.creatCGeo( contour );
			gGeo3.applyMatrix( _Collects.Matrix() );
			
			var gGeo1 = _Geometries.geo(),
				gGeo2 = _Geometries.geo();
			
			for ( var i=0; i<num; i++ ) {
				var r1 = Math.floor( Math.random()*len2 ),
					r2 = Math.floor( Math.random()*len2 );
				
				gGeo1.vertices.push( gGeo3.vertices[ r1 ] );
				gGeo2.vertices.push( gGeo3.vertices[ r2 ] );
			}
			
			var	outerGlow = new THREE.Points( gGeo1, _Materials.point({ 
				color: 0xFFFFFF, opacity: opts.gc[1]*_o, size: 54*opts.gs,
				transparent: true, map: _Tdata.txues._df_p1, depthTest: false,
			}) );
			
			outerGlow.add( new THREE.Points( gGeo2, df_pointMtl ) );
			outerGlow.add( new THREE.Points( gGeo3, df_pointMtl2 ) );
			
			outerGlow.position.y = -1;
			outerGlow.children[0].position.y = -2;
			outerGlow.children[1].position.y = 1.2;
			
			outerGlow._isGlow = true;
			outerGlow._optRatio = _o;
			
			outerGlow._color = opts.gc[0];
			outerGlow._opacity = opts.gc[1]*_o;
			
			//-
			outerGlow._flicker = true;
			outerGlow._transTimes = 0;
			outerGlow._perTimes = opts.gp;
			outerGlow._ratio = Math.random();
			
			return outerGlow;
		},
		
		creatSVGLine: function ( lGeo, cArr, r, w ) {
			var	_line = new THREE.Mesh( lGeo, _Materials.shader({
				uniforms: {
					u_color: { value: cArr[0] }, u_opacity: { value: cArr[1]*r }, u_width: { value: -w }, 
				}, transparent: true, side: THREE.DoubleSide, depthWrite: false,
				vertexShader: _Shaders.SplineVShader, fragmentShader: _Shaders.SplineFShader,
			}) );
			
			_line.position.y = _Tdata.ry;
			
			_line._isSVGLine = true;
			_line._optRatio = r;
			
			_line._color = cArr[0];
			_line._opacity = cArr[1]*r;
			
			return _line;
		},
		
		creatShape: function ( shapGeo, bc, hlc, r, hy ) {
			var _shape = new THREE.Mesh( shapGeo, _Materials.lambert({
				color: bc[0], opacity: bc[1]*r, transparent: true, side: THREE.DoubleSide,
			}) );
			
			_shape.position.y = hy;
			
			_shape._isShape = true;
			_shape._color = bc[0];
			_shape._opacity = bc[1]*r;
			_shape._hlColor = hlc[0];
			_shape._hlOpacity = hlc[1]*r;
			return _shape;
		},
		
		creatTags: function ( name, opts, vec, pArr ) {
			var obj = _Collects.obj(), pl = pArr.length;
			
			for ( var i=0; i<pl; i++ ) {
				var _txue = _Tdata.txues[ '_'+pArr[i].txue ],
					_size = _Collects.clamp( pArr[i].size*1, 1, 64, 3 ),
					_text = pArr[i].text || [name],
					_offx = ( pArr[i].offset || [] )[0]*1 || 0,
					_offy = ( pArr[i].offset || [] )[1]*1 || 0,
					_tOffx = ( pArr[i].textOffset || [] )[0]*1 || 0,
					_tOffy = ( pArr[i].textOffset || [] )[1]*1 || 0,
					_color = _Collects.getColorArr( pArr[i].color ),
					_mouseEvent = ( pArr[i].mouseEvent === true ),
					
					_vec3 = vec.clone().add( new THREE.Vector3( _offx, 0, _offy ) ),
					_tVec3 = _vec3.clone().add( new THREE.Vector3( _tOffx, 1, _tOffy ) );
				
				//-
				var tGeo = _Geometries.geo();
				tGeo.vertices.push( _tVec3 );
				
				// var sColor = _txue? '#1E5892': '#051333';
				var sColor = _txue? '#00fff9': '#051333';
				var sBlur = _txue? 36: 24;
				var txue = _Collects.creatTagsArrTxue( _text, sColor, sBlur );
				var _s = txue._scale * opts.fs;
				
				var _tags = new THREE.Points( tGeo, _Materials.point({
					size: _s, color: opts.fc[0], opacity: opts.fc[1], map: txue, 
					transparent: true, depthWrite: false, //sizeAttenuation: false,
				}) );
				_tags.position.y += opts.fs*4;
				_tags._isTags = true;
				_tags._txue = pArr[i].txue;
				_tags._text = _text;
				_tags._color = opts.fc[0];
				_tags._opacity = opts.fc[1];
				
				_tags._visible = _tags.visible;
				
				_tags._hasChild = false;
				
				//-
				if ( _txue ) {
					_tags._hasChild = true;
					var _spot = _Collects.creatSpot( _color, _vec3, _txue, _size );
					_tags.add( _spot );
					
					//-
					if ( !df_LableMtl ){
						df_LableMtl = _Materials.basic({ 
							transparent: true, depthWrite: false, side: THREE.DoubleSide, opacity: 0
						});
					}
					var geo = _Geometries.plane( 16+_size, 16+_size );
					geo.applyMatrix( _Collects.Matrix() );
					var _label = new THREE.Mesh( geo, df_LableMtl );
					_label.position.copy( _vec3 );
					_label.position.y += 1;
					_label._isLabel = true;
					_label._text = _text;
					
					_tags.add( _label );
					if ( _mouseEvent ) thm.mEventArr.push( _label );
				}
				
				obj.add( _tags );
			}
			
			return obj;
		},
		
		creatSpot: function ( cArr, vec, txue, s ) {
			
			var pGeo = _Geometries.buf(), vArr = [ vec.x, vec.y, vec.z ];
			pGeo.addAttribute( 'cOffset', new THREE.Float32BufferAttribute( [0], 1 ) );
			pGeo.addAttribute( 'position', new THREE.Float32BufferAttribute( vArr, 3 ) );
			
			var sk = df_Height/647;
			var _spot = new THREE.Points( pGeo,_Materials.shader({
				uniforms: {
					u_txue: { value: txue }, u_time: { value: 0 }, 
					u_color: { value: cArr[0] }, u_opacity: { value: cArr[1] }, u_size: { value: s*sk },
				}, transparent: true, depthWrite: false,
				vertexShader: _Shaders.SpotVShader, fragmentShader: _Shaders.SpotFShader,
			}) );
			
			_spot._type = 1;
			_spot._size = s;
			
			_spot._isSpot = true;
			_spot._color = cArr[0];
			_spot._opacity = cArr[1];
			
			return _spot;
		},
		
		creatTagsArrTxue: function ( textArr, sColor, sBlur ) {
			var ta = textArr || [], cvs1, ctx1;
			cvs1 = document.createElement("canvas");
			ctx1 = cvs1.getContext("2d");
			
			var s1 = 120, s2 = 10, s3 = s1/2;
			ctx1.font = "bold 100px Arial";
			
			//-
			var row = ta.length, _tw = 0;
			for ( var i=0; i<row; i++ ) {
				var t = ta[i] || '';
				_tw = Math.max( _tw, ctx1.measureText(t).width );
			}
			var mw = Math.max( row*s1, _tw+s2 );
			var _w = Math.max( 128, THREE.Math.nextPowerOfTwo(mw) );
			cvs1.width = cvs1.height = _w;
			
			//-
			ctx1.font = "normal 100px Arial";
			ctx1.textAlign = "left";
			ctx1.textBaseline = "middle";
			
			ctx1.shadowBlur = sBlur || 54;
			ctx1.shadowColor = sColor || "#1E5892";
			
			//-
			ctx1.fillStyle = "#fff";
			var sy = _w/2 - row*s3 + s3;
			for ( var j=0; j<row; j++ ) {
				var tj = ta[j] || '';
				ctx1.fillText( tj, (_w-_tw)/2, sy+j*s1 );
			}
			
			var texture1 = new THREE.Texture( cvs1 );
			texture1.needsUpdate = true;	
			texture1._scale = _w/16;
			
			return texture1;
		},
		
		creatTagsTxue: function ( text ) {
			var t = text || "", cvs1, ctx1;
			cvs1 = document.createElement("canvas");
			ctx1 = cvs1.getContext("2d"); 
			
			ctx1.font = "bold 100px Arial";
			var _tw = ctx1.measureText(t).width + 2,
				_w = Math.max( 128, THREE.Math.nextPowerOfTwo( _tw ) );
			cvs1.width = cvs1.height = _w;
			
			//-
			ctx1.font = "bold 100px Arial";
			ctx1.textAlign = "center";
			ctx1.textBaseline = "middle";
			
			ctx1.shadowBlur = 36;
			ctx1.shadowColor = "#000";
			
			ctx1.fillStyle = "#FFF";
			ctx1.fillText( t, _w/2, _w/2 );
			
			var texture1 = new THREE.Texture( cvs1 );
			texture1.needsUpdate = true;	
			texture1._scale = _w/16;
			
			return texture1;
		},
		
		//- analysis svg path
		transformSVGPath: function ( pathStr ) {
			var paths = [];
			var path = new THREE.Shape();
			
			var DEGS_TO_RADS = Math.PI / 180, PERIOD = 46, MINUS = 45, // . -
				DIGIT_0 = 48, DIGIT_9 = 57, COMMA = 44, SPACE = 32; // 0 9 , 空格

			var idx = 1, len = pathStr.length, activeCmd,
				x = 0, y = 0, nx = 0, ny = 0, cx, cy, firstX = null, firstY = null,
				x1 = null, y1 = null, x2 = null, y2 = null, rx = 0, ry = 0, xar = 0, laf = 0, sf = 0;

			function eatNum() {
				var sidx, c, isFloat = false, s, k=0;
				while ( idx < len ) {
					c = pathStr.charCodeAt(idx);
					if (c !== COMMA && c !== SPACE) { break; }
					idx++;
				}
				if ( c === MINUS ) { sidx = idx++; }
				else { sidx = idx; }
				
				while ( idx < len ) {
					c = pathStr.charCodeAt( idx );
					if ( DIGIT_0 <= c && c <= DIGIT_9 ) {
						idx++;  continue;
					} else if ( c === PERIOD && k<1 ) {
						idx++; k++; isFloat = true; continue;
					}
					s = pathStr.substring( sidx, idx );
					return isFloat ? parseFloat( s ) : parseInt( s );
				}

				s = pathStr.substring( sidx );
				return isFloat ? parseFloat( s ) : parseInt( s );
			}

			function nextIsNum() {
				var c;
				while ( idx < len ) {
					c = pathStr.charCodeAt( idx );
					if ( c !== COMMA && c !== SPACE ) { break; }
					idx++;
				}
				c = pathStr.charCodeAt( idx );
				return ( c === MINUS || ( DIGIT_0 <= c && c <= DIGIT_9 ) );
			}

			var canRepeat;
			var enteredSub = false;
			var zSeen = false;
			activeCmd = pathStr[0];

			while ( idx <= len ) {
				canRepeat = true;
				switch (activeCmd) {
					case 'M':
						enteredSub = false;
						x = eatNum();
						y = eatNum();
						path.moveTo( x, y );
						activeCmd = 'L';
						break;
					case 'm':
						x += eatNum();
						y += eatNum();
						path.moveTo( x, y );
						activeCmd = 'l';
						break;
					case 'Z':
					case 'z':
						canRepeat = false;
						if ( x !== firstX || y !== firstY ) { path.lineTo(firstX, firstY); }
						paths.push( path );
						firstX = null;
						firstY = null;
						enteredSub = true;
						path = new THREE.Shape();
						zSeen = true;
						break;
					case 'L':
					case 'H':
					case 'V':
						nx = ( activeCmd === 'V' ) ? x : eatNum();
						ny = ( activeCmd === 'H' ) ? y : eatNum();
						path.lineTo( nx, ny );
						x = nx;
						y = ny;
						break;
					case 'l':
					case 'h':
					case 'v':
						nx = ( activeCmd === 'v' ) ? x : ( x + eatNum() );
						ny = ( activeCmd === 'h' ) ? y : ( y + eatNum() );
						path.lineTo( nx, ny );
						x = nx;
						y = ny;
						break;
					case 'C':
						x1 = eatNum(); y1 = eatNum();
					case 'S':
						if ( activeCmd === 'S' ) { 
							x1 = (x2 === null)? x: 2 * x - x2; 
							y1 = (y2 === null)? y: 2 * y - y2; 
						}
						x2 = eatNum();
						y2 = eatNum();
						nx = eatNum();
						ny = eatNum();
						path.bezierCurveTo( x1, y1, x2, y2, nx, ny );
						x = nx; y = ny;
						break;
					case 'c':
						x1 = x + eatNum();
						y1 = y + eatNum();
					case 's':
						if ( activeCmd === 's' ) { 
							x1 = (x2 === null)? x: 2 * x - x2; 
							y1 = (y2 === null)? y: 2 * y - y2; 
						}
						x2 = x + eatNum();
						y2 = y + eatNum();
						nx = x + eatNum();
						ny = y + eatNum();
						path.bezierCurveTo( x1, y1, x2, y2, nx, ny );
						x = nx; y = ny;
						break;
					case 'Q':
						x1 = eatNum(); y1 = eatNum();
					case 'T':
						if ( activeCmd === 'T' ) { 
							x1 = (x1 === null)? x: 2 * x - x1; 
							y1 = (y1 === null)? y: 2 * y - y1; 
						}
						nx = eatNum();
						ny = eatNum();
						path.quadraticCurveTo( x1, y1, nx, ny );
						x = nx;
						y = ny;
						break;
					case 'q':
						x1 = x + eatNum();
						y1 = y + eatNum();
					case 't':
						if ( activeCmd === 't' ) { 
							x1 = (x1 === null)? x: 2 * x - x1; 
							y1 = (y1 === null)? y: 2 * y - y1; 
						}
						nx = x + eatNum();
						ny = y + eatNum();
						path.quadraticCurveTo( x1, y1, nx, ny );
						x = nx; y = ny;
						break;
					case 'A':
					case 'a':
						rx = eatNum();
						ry = eatNum();
						xar = eatNum() * DEGS_TO_RADS;
						laf = eatNum();
						sf = eatNum();
						nx = ( activeCmd === 'a' )? x + eatNum(): eatNum();
						ny = ( activeCmd === 'a' )? y + eatNum(): eatNum();
						
						//-
						x1 = Math.cos(xar) * (x - nx) / 2 + Math.sin(xar) * (y - ny) / 2;
						y1 = -Math.sin(xar) * (x - nx) / 2 + Math.cos(xar) * (y - ny) / 2;
						
						var norm = Math.sqrt( (rx*rx * ry*ry - rx*rx * y1*y1 - ry*ry * x1*x1) / (rx*rx * y1*y1 + ry*ry * x1*x1) );
						if ( laf === sf ) { norm = -norm; }
						x2 = norm * rx * y1 / ry;
						y2 = norm * -ry * x1 / rx;
						
						cx = Math.cos(xar) * x2 - Math.sin(xar) * y2 + (x + nx) / 2;
						cy = Math.sin(xar) * x2 + Math.cos(xar) * y2 + (y + ny) / 2;
						
						//-
						var u = new THREE.Vector2(1, 0),
							v = new THREE.Vector2( (x1 - x2) / rx, (y1 - y2) / ry );
						var startAng = Math.acos( u.dot(v) / u.length() / v.length() );
						if ( u.x * v.y - u.y * v.x < 0 ) { startAng = -startAng; }
						
						u.x = ( -x1 - x2 ) / rx;
						u.y = ( -y1 - y2 ) / ry;
						
						//-
						var deltaAng = Math.acos( v.dot(u) / v.length() / u.length() );
						if ( v.x * u.y - v.y * u.x < 0 ) { deltaAng = -deltaAng; }
						if ( !sf && deltaAng > 0 ) { deltaAng -= Math.PI * 2; }
						if ( sf && deltaAng < 0 ) { deltaAng += Math.PI * 2; }
						
						//-
						var cw = (sf === 1)? false: true;
						// path.absarc(cx, cy, rx, startAng, startAng + deltaAng, cw);
						path.absellipse(cx, cy, rx, ry, startAng, startAng + deltaAng, cw );
						x = nx;
						y = ny;
						x1 = null;
						y1 = null;
						x2 = null;
						y2 = null;
						break;
					case ' ':
						break;
					default:
						throw new Error( "weird path command: " + activeCmd );
				}
				if ( firstX === null && !enteredSub ) { firstX = x; firstY = y; }
				if ( canRepeat && nextIsNum() ) { continue; }
				activeCmd = pathStr[ idx++ ];
			}

			if ( zSeen ) { return paths; } 
			else { paths.push( path ); return paths; }
		},
		
		//- analysis color
		getColorArr: function( str ) {
			if ( isArray(str) ) return str;
			var _arr = [];
			str = str + '';
			str = str.toLowerCase().replace(/\s/g,"");
			if( /^((?:rgba)?)\(\s*([^\)]*)/.test( str ) ){
				var arr = str.replace(/rgba\(|\)/gi,'').split(',');				
				var hex = [
					pad2( Math.round( arr[0]*1 || 0 ).toString(16) ),
					pad2( Math.round( arr[1]*1 || 0 ).toString(16) ),
					pad2( Math.round( arr[2]*1 || 0 ).toString(16) )
				];				
				_arr[0] = _Collects.color( '#'+hex.join("") );
				_arr[1] = Math.max(0, Math.min(1, (arr[3]*1 || 0) ) );
			} else if ( 'transparent' === str ) {
				_arr[0] = _Collects.color(); _arr[1] = 0;
			} else {
				_arr[0] = _Collects.color( str ); _arr[1] = 1;
			}
			
			function pad2(c){
				return c.length == 1 ? '0' + c : '' + c;
			}			
			return _arr;
		},
		
		//- loadTexture
		loadTexture: function () {
			var _n = df_Config.texture;
			df_txueLoader = new THREE.TextureLoader();
				
			_Tdata.txues._spot = _Collects.creatSpotTexture();
			for ( var k in _n ) {
				_Tdata.txues['_'+k] = df_txueLoader.load( _n[k] );
			}
		},
		
		creatSpotTexture: function ( size, power ) {
			var s = size * 16 || 256, m = power || 2,
				cvs = document.createElement("canvas"),		
				ctx = cvs.getContext("2d");		
			cvs.width = s; cvs.height = s;			
			var i, c = 255, p = s/2, r = s/2, 
				grad = ctx.createRadialGradient(p,p,0,p,p,r),
				Cubic = function (k, n) {
					if (n === 2) return k * k;
					if (n === 3) return k * k * k;
					return k;
				};
			for(i=0; i<s; i++) {
				var p1 = (i/(s-1)).toFixed(2) * 1,
					o = (1 - p1) * 0.8, 
					o1 = Cubic(o, m).toFixed(2),						
					c1 = 'rgba('+c+','+c+','+c+','+o1+')';
				grad.addColorStop(p1, c1);
			}			
			ctx.fillStyle = grad;
			ctx.arc( p, p, r, 0, 2*Math.PI );
			ctx.fill();
			var texture = new THREE.Texture(cvs);
			texture.needsUpdate = true;				
			return texture;
		},
	};
	
	var _Materials = {
		point: function( param ) { return new THREE.PointsMaterial( param ); },
		line: function( param ) { return new THREE.LineBasicMaterial( param ); },
		lineD: function( param ) { return new THREE.LineDashedMaterial( param ); },	
		
		sprite: function ( param ) { return new THREE.SpriteMaterial( param ); },
		shader: function ( param ) { return new THREE.ShaderMaterial( param ); },
		phong: function( param ) { return new THREE.MeshPhongMaterial( param ); },
		basic: function ( param ) { return new THREE.MeshBasicMaterial( param ); },
		lambert: function ( param ) { return new THREE.MeshLambertMaterial( param ); },
		standard: function ( param ) { return new THREE.MeshStandardMaterial( param ); },
	};
	
	var _Geometries = {
		geo: function () { return new THREE.Geometry(); },
		buf: function () { return new THREE.BufferGeometry(); },
		
		shape: function (shp, seg) { return new THREE.ShapeGeometry( shp, seg ); },
		extrude: function (shp, opt) { return new THREE.ExtrudeGeometry( shp, opt ); },
		
		box: function (w, h, d) { return new THREE.BoxGeometry( w, h, d ); },
		sphere: function (r, ws, hs ) { return new THREE.SphereGeometry( r, ws, hs ); },
		torus: function (r, t, rs, ts) { return new THREE.TorusGeometry( r, t, rs, ts ); },		
		circle: function (r, s) { return new THREE.CircleGeometry( r, s ); },
		Icosah: function (r, s) { return new THREE.IcosahedronGeometry( r, s ); },
		plane: function (w, h, ws, hs) { return new THREE.PlaneGeometry( w, h, ws, hs ); },
		cylinder: function (rt, rb, h, rs, o) { return new THREE.CylinderGeometry( rt, rb, h, rs, 1, o ); },
	};
	
	var _Tdata = {
		M_PI: 6.2831853071795865, M_PI2: 1.57079632679489662, sl: 7.2,
		wh: 400, st: 400, py: 3, ry: .1, txues: {}, easings: [ _Collects.ease1, _Collects.ease2 ]
	};
	
	//-
	function init3DMesh ( data ) {
        console.log('init3DMesh');
        console.log('init3DMesh---data---',data);
		thm.SVGMapData = $.extend( true, {}, thm.SVGMapData, data );
        console.log('init3DMesh---thm---',thm);
        console.log('init3DMesh---thm.SVGMapData---',thm.SVGMapData);
		
		if ( thm.mapObject ) {			
			thm.mapObject.traverse( function ( child ) {
				if ( child.geometry ) child.geometry.dispose();
				if ( child.material ) child.material.dispose();
			});				
			thm.scene.remove( thm.mapObject );
			
			thm.shapesArr = [];
			thm.mEventArr = [];
			thm.shapesArrLen = 0;
			
			thm.SVGMapObj = {};
		}
		
		thm.mapObject = _Collects.obj();
		thm.scene.add( thm.mapObject );
		
		// _Collects.handleTags();
		_Collects.handleBlock();
		_Collects.handleBorder();
		_Collects.handleGlow();
		
		//-
		var series = thm.SVGMapData.series || [];
		handleSeries( series, {
			//
			_fc: df_Config.tags.fontColor,
			_fh: df_Config.tags.fontHover,
			_fs: df_Config.tags.fontSize,
			//
			_bc: df_Config.sceneStyle.blockColor,
			_hlc: df_Config.sceneStyle.highLightColor,
			//
			_lc: df_Config.sceneStyle.borderColor, 
			_lw: df_Config.sceneStyle.borderWidth, 
			//
			_gc: df_Config.outerGlow.glowColor,
			_gs: df_Config.outerGlow.size,
			_gp: df_Config.outerGlow.perTime,
		} );
		
		thm.mapObject.scale.copy( thm.WHRatio );
		thm.mapObject.position.copy( thm.svgOffset );
		
		var _prt = new THREE.Vector3( .016, 1, .016 );
		for ( var j=thm.shapesArrLen-1, k=0; j>=0; j--, k++ ) {
			var shi = thm.shapesArr[j],
				_r1 = Math.random(), _r2 = Math.random(),
				_vec = new THREE.Vector3( _r1*10+15, 1, _r2*10+15 );
			shi._center.multiply( thm.WHRatio ).add( thm.svgOffset );
			shi._admisDic = shi._center.clone().multiply( _vec );
			shi.position.copy( shi._center.clone().multiply( _prt ) );
			shi._position = shi.position.clone();
			
		}
		
	}
	
	function handleSeries ( series, opts ) {
        console.log('handleSeries');
		series = series || [];
		var _testGeo = _Geometries.geo();
		
		var _nky, _vec, _rd, r1 = 1, r2 = .6, r3 = .3, _mnky=0;
		var lc = opts._lc, lw = opts._lw, bc = opts._bc, hlc = opts._hlc;
		
		var _tOpt = { fc: opts._fc, fh: opts._fh, fs: opts._fs },
			_gopt = { gc: opts._gc, gs: opts._gs, gp: opts._gp };
		
		for ( var i=series.length-1; i>=0; i-- ) {
			var _id = series[i]._id;
			if ( _id ) {
				var _t = series[i].name || 'noName'+_id,
					_p = series[i].point || [],
					_c = _Collects.getColorArr( series[i].color ),
					_h = isNaN(series[i].height*3)? 3: series[i].height*3, 
					_Shapes = _Collects.transformSVGPath( series[i].path )[0];
				
				var contour = _Shapes.getPoints(6);
				var _sGeo = _Collects.creatShapeGeo( contour );
				_sGeo.applyMatrix( _Collects.Matrix() );
				_testGeo.merge( _sGeo );
				
				var	_lGeo = _Collects.creatSplineGeo( contour, { type: 1 } );
				_lGeo.applyMatrix( _Collects.Matrix() );
				
				_nky = 5 * _h; _mnky = Math.max( _nky, _mnky );
				var _extr = _Collects.creatShape( _sGeo, bc, hlc, r1, 0 ),
					_extr1 = _Collects.creatShape( _sGeo, bc, hlc, r2, -8 ),
					_extr2 = _Collects.creatShape( _sGeo, bc, hlc, r3, -20 ),
					_nExtr = _Collects.creatShape( _sGeo, bc, hlc, r1, _nky ),
					_line = _Collects.creatSVGLine( _lGeo, lc, r1, lw ),
					_line1 = _Collects.creatSVGLine( _lGeo, lc, r2, lw ),
					_line2 = _Collects.creatSVGLine( _lGeo, lc, r3, lw ),
					_glow = _Collects.creatOuterGlow( _Shapes, _gopt );
				
				_nExtr._path_id = _extr._path_id = _id;
				_nExtr._name = _extr._name = _t;
				
				_nExtr.material.opacity = 0;
				_nExtr.material.depthWrite = false;
				
				_sGeo.computeBoundingSphere();
				_vec = _sGeo.boundingSphere.center;
				_rd = _sGeo.boundingSphere.radius;
				var center = _vec.clone().setY( _nky );
				_nExtr._radius = _extr._radius = _rd;
				_nExtr._center = _extr._center = center;
				
				var _rt = _Tdata.wh / (_rd*2.2),
					_WHRatio = new THREE.Vector3( _rt, 1, _rt ),
					_svgOffset = new THREE.Vector3( -_vec.x*_rt, 0, -_vec.z*_rt );
				_nExtr._WHRatio = _extr._WHRatio = _WHRatio;
				_nExtr._svgOffset = _extr._svgOffset = _svgOffset;
				
				var _tags = _Collects.creatTags( _t, _tOpt, _vec, _p );
				
				_extr.add( _line, _glow, _tags );
				
				_extr1.add( _line1 ); _extr2.add( _line2 );
				_nExtr.add( _extr, _extr1, _extr2 );
				
				thm.mapObject.add( _nExtr );
				thm.shapesArr.push( _nExtr );
				thm.mEventArr.push( _nExtr );
				
				thm.SVGMapObj[_t] = series[i];
				
			}
		}
		thm.shapesArrLen = thm.shapesArr.length;
		getRtoAndOft( _testGeo );
		
		//-
		var _hGeo = _Geometries.plane( thm.SVGMapData._width||0, thm.SVGMapData._height||0 );
		_hGeo.applyMatrix( new THREE.Matrix4().makeRotationX( -_Tdata.M_PI2 ) );
		
		var offset = _testGeo.boundingBox.getCenter();
		for ( var v in _hGeo.vertices ) {
			_hGeo.vertices[v].add( offset.clone().setY(1) )
		}
		
		thm.HeatMapObj = new THREE.Mesh( _hGeo, _Materials.basic({ 
			opacity: 0, map: null, transparent: true, side: THREE.DoubleSide, depthWrite: false,
		}) );
		
		thm.HeatMapObj.position.y = _mnky+1;
		thm.HeatMapObj._visible = thm.HeatMapObj.visible;
		thm.mapObject.add( thm.HeatMapObj );
	}
	
	function getRtoAndOft ( tGeo ) {
		tGeo.computeBoundingBox();
		var _size =  tGeo.boundingBox.getSize(),
			_offset = tGeo.boundingBox.getCenter(),
			_rat = _Tdata.wh / Math.max( _size.x, _size.z );
		
		thm.WHRatio.set( _rat, 1, _rat );
		thm.svgOffset.set( -_offset.x*_rat, 0, -_offset.z*_rat );
	}
	
	//-
    function setHeatMap( datas, radius ) {
		
		var heatmap = HEATMap.create({
	     	container: document.createElement("div"),
			width: 584,
			height: 842,
	     	maxOpacity: .95,
	      	radius: 10,
	      	blur: .95,
	    });
		
	    var extremas = [(Math.random() * 1000) >> 0,(Math.random() * 1000) >> 0];
	    var max = Math.max.apply(Math, extremas);
	    var min = Math.min.apply(Math,extremas);
	    var t = [];
		
	    for (var i = 0,length = datas.length; i < length; i++) {
	        var lng = datas[i].x, lat = datas[i].y;
	        var xy = thm.coordTrans.calRelativeCoor(lng,lat);
	        var c = 800, r =radius||20;
	        t.push( { x: Math.floor(xy[0]), y: Math.floor(xy[1]), value: c, radius: r } );
	    }
	    
	    heatmap.setData({
	        min: 100,
	        max: 800,
	        data: t
	    });
		
		thm.HeatMapObj.material.opacity = 1;
		thm.HeatMapObj.material.map = df_txueLoader.load( heatmap.getDataURL() );
		thm.HeatMapObj.material.needsUpdate = true;
    }
	
	//- animation
	function animation ( dt ) {
		if ( dt < .1 && df_MouseEvent ) {
			thm.mapObject.traverse( function( child ) {
				if ( child._isGlow && child.visible ) {
					if ( child._flicker ) {
						var _times = child._perTimes; child._transTimes += dt;
						var _k = child._ratio - child._transTimes / _times;
						if ( _k >= 0 ) _k += 1;
						child.material.opacity = child._opacity * (1+Math.cos( _k*_Tdata.M_PI )*.4);
						if ( child._transTimes >= _times ) child._transTimes -= _times;
					}
				}
			} );
		}
		
		df_AdmisDic.type && thm.shapesArrLen && setAdmisDic( dt );
		!df_AdmisDic.type && thm.shapesArrLen && AdmisDicRestore();
		
	}
	
	// AdmissionDynamic
	function setAdmisDic ( dt ) {
		var _per = df_AdmisDic.perTime;
		if ( df_AdmisDic._transTimes >= _per ) return;
		
		AdmisDicBefore();
		
		if ( dt < .1 ) {
			df_AdmisDic._transTimes += dt;
			var _k = Math.min(1, df_AdmisDic._transTimes/_per), 
				_rk = 1-_k, _vec = new THREE.Vector3( _rk*_rk*_rk, 0, _rk*_rk*_rk );
				
			for ( var j=thm.shapesArrLen-1; j>=0; j-- ) {
				var shpi = thm.shapesArr[j];
				if( df_AdmisDic.type === 1 ) {
					var shicc = shpi.children[0].children[2];
					shpi.position.copy( shpi._position.clone().add( shpi._admisDic.clone().multiply( _vec ) ) );
					if ( _k >= 1 ) shicc.visible = shicc._visible;
				}
			}
			
			if ( _k >= 1 ) { df_MouseEvent = true; thm.HeatMapObj.visible = thm.HeatMapObj._visible; }
		}
	}
	
	function AdmisDicBefore () {
		if ( df_AdmisDic._transTimes < 0 ) {
			df_MouseEvent = false;
			df_AdmisDic._transTimes = 0;
			for ( var j=thm.shapesArrLen-1; j>=0; j-- ) {
				if( df_AdmisDic.type === 1 ) {
					var shi = thm.shapesArr[j],
						shicc = shi.children[0].children[2];
					shi.position.copy( thm.shapesArr[j]._admisDic.clone() );
					shicc.visible = false;
				}
			}
			thm.HeatMapObj.visible = false;
		}
	}
	
	function AdmisDicRestore () {
        console.log('AdmisDicRestore');
		if ( undefined == df_AdmisDic._transTimes || df_AdmisDic._transTimes < 0 ) return;
		
		thm.mapObject.scale.copy( thm.WHRatio );
		thm.mapObject.position.copy( thm.svgOffset );
		df_MouseEvent = true;  df_AdmisDic._transTimes = -1;
		for ( var j=thm.shapesArrLen-1; j>=0; j-- ) {
			var shi = thm.shapesArr[j],
				shicc = shi.children[0].children[2];
			shi.position.copy( thm.shapesArr[j]._position );
			shicc.visible = shicc._visible;
		}
		thm.HeatMapObj.visible = thm.HeatMapObj._visible;
	}
	
	// mouse event
	function onDocumentMouseUp ( event ) {}
		
	function onDocumentMouseWheel ( event ) {}
	
	function onDocumentMouseOut ( event ) { 
		thm.container[0].style.cursor = 'auto';
		if ( df_ItdMesh ) {
			if ( df_ItdMesh._isLabel ) {
				_Collects.opacityTvs( df_ItdMesh.parent, 1 );
				df_ItdMesh.parent.material.blending = THREE.NormalBlending;
				df_ItdMesh.parent.children[0].material.blending = THREE.NormalBlending;
			}
			if ( df_ItdMesh._isShape ) {
				_Collects.opacityTvs( df_ItdMesh, 1 );
				df_ItdMesh.material.blending = THREE.NormalBlending;
				df_ItdMesh.children[0].material.blending = THREE.NormalBlending;
			}
		}
		df_ItdMesh = null;
	}
	
	function onDocumentMouseMove ( event ) {
		event.preventDefault();
		if ( df_MouseEvent ) {
			df_Mouse.x = ( event.layerX / df_Width ) * 2 - 1;
			df_Mouse.y = - ( event.layerY / df_Height ) * 2 + 1;
            // console.log('df_Mouse',df_Mouse);
            // console.log('thm.camera',thm.camera);
			df_Raycaster.setFromCamera( df_Mouse, thm.camera );
			df_Intersects = df_Raycaster.intersectObjects( thm.mEventArr );
			
			if ( df_Intersects.length > 0 ) {
				thm.container[0].style.cursor = 'pointer';
				
				if ( df_ItdMesh ) {
					if ( df_ItdMesh._isLabel ) {
						_Collects.opacityTvs( df_ItdMesh.parent, 1 );
						df_ItdMesh.parent.material.blending = THREE.NormalBlending;
						df_ItdMesh.parent.children[0].material.blending = THREE.NormalBlending;
					}
					if ( df_ItdMesh._isShape ) {
						_Collects.opacityTvs( df_ItdMesh, 1 );
						df_ItdMesh.material.blending = THREE.NormalBlending;
						df_ItdMesh.children[0].material.blending = THREE.NormalBlending;
					}
				}
				
				var obj = df_Intersects[0].object;
				if ( obj._isLabel ) {
					df_ItdMesh = obj;
					_Collects.opacityTvs( df_ItdMesh.parent, 1.2 );
					df_ItdMesh.parent.material.blending = THREE.AdditiveBlending;
					df_ItdMesh.parent.children[0].material.blending = THREE.AdditiveBlending;
				}
				if ( obj._isShape ) {
					df_ItdMesh = obj.children[0];
					_Collects.opacityTvs( df_ItdMesh, 1.2 );
					df_ItdMesh.material.blending = THREE.AdditiveBlending;
					df_ItdMesh.children[0].material.blending = THREE.AdditiveBlending;
				}
				
			} else {
				thm.container[0].style.cursor = 'auto';
				
				if ( df_ItdMesh ) {
					if ( df_ItdMesh._isLabel ) {
						_Collects.opacityTvs( df_ItdMesh.parent, 1 );
						df_ItdMesh.parent.material.blending = THREE.NormalBlending;
						df_ItdMesh.parent.children[0].material.blending = THREE.NormalBlending;
					}
					if ( df_ItdMesh._isShape ) {
						_Collects.opacityTvs( df_ItdMesh, 1 );
						df_ItdMesh.material.blending = THREE.NormalBlending;
						df_ItdMesh.children[0].material.blending = THREE.NormalBlending;
					}
				}
				df_ItdMesh = null;
			}
		}
	}
	
	function onDocumentMouseDown ( event ) {
        console.log('onDocumentMouseDown');
		event.preventDefault();
		df_Mouse.x = ( event.layerX / df_Width ) * 2 - 1;
		df_Mouse.y = - ( event.layerY / df_Height ) * 2 + 1;
		df_Raycaster.setFromCamera( df_Mouse, thm.camera );
		df_Intersects = df_Raycaster.intersectObjects( thm.mEventArr );
		
		if ( df_Intersects.length > 0 ) {
			var obj = df_Intersects[0].object;
			if ( df_ItdMesh._isLabel ) {
				var _p = obj.parent.parent.parent;
				df_MouseDownCallback( obj._text, transCoord( _p._center ), thm.SVGMapObj[_p._name], 2, event );
			}
			if ( obj._isShape ) {
				df_MouseDownCallback( obj._name, transCoord( obj._center ), thm.SVGMapObj[obj._name], 1, event );
			}
		}
	}
	
	function onContResize ( event ) {
        console.log('onContResize');
		var wh = getWH();
		df_Width = wh.w; df_Height = wh.h;
		thm.camera.aspect = wh.w/wh.h;
		thm.renderer.setSize(wh.w, wh.h);
		thm.camera.updateProjectionMatrix();
		
		thm.mapObject.traverse( function( child ) {
			if ( child._isSpot ) {
				child.material.uniforms.u_size.value = child._size*df_Height/647;
				
			}
		} );
    }
    
    
    
    // 淡入效果
    function fadeIn (element,speedTime) {
        let speed = speedTime || 30 ;
        let num = 0;
        let st = setInterval(function(){
            num++;
            element.style.opacity = num/10;
            if(num>=10)  {  
                clearInterval(st);  
            }
        },speed);
    }
    // 淡出效果
    function fadeOut (element,speedTime) {
        let speed = speedTime || 30 ;
        let num = 10;
        let st = setInterval(function(){
            num--;
            element.style.opacity = num / 10 ;
            if(num<=0)  {   
                clearInterval(st);  
            }
        },speed);
    }
	
	//- renderer
	function renderers ( func ) {
        console.log('renderers');
		var fnc = toFunction( func );
		var Animations = function() {
			if ( is_Init ) {
				var delta = df_Clock.getDelta();
				if( delta>0 ) animation( delta );
				
				thm.controls.update();
				fnc.bind( thm )( delta );
				thm.renderer.render( thm.scene, thm.camera );
				requestAnimationFrame( Animations );
			}
        };
        Animations();
	}
	
	function testing () {
		return thm.renderer instanceof THREE.WebGLRenderer;
	}
	
	function getWH () {
		return { w: thm.container.width(), h: thm.container.height() };
	}
	
	function setControls ( controls, opts, isInit ) {
        console.log('setControls');
		
		controls.enablePan = opts.enablePan;
		controls.enableKeys = opts.enablePan;
		controls.enableZoom = opts.enableZoom;
		controls.enableRotate = opts.enableRotate;
		
		if ( isInit ) {
			var _opts = default_Config.controls;
			
			controls.enableDamping = _opts.enableDamping;
			controls.dampingFactor = _opts.dampingFactor;
			
			controls.panSpeed = _opts.panSpeed;
			controls.zoomSpeed = _opts.zoomSpeed;
			controls.rotateSpeed = _opts.rotateSpeed;
			
			controls.minDistance = _opts.distance[0];
			controls.maxDistance = _opts.distance[1];
			controls.minPolarAngle = _opts.polarAngle[0];
			controls.maxPolarAngle = _opts.polarAngle[1];
			controls.minAzimuthAngle = _opts.azimuthAngle[0];
			controls.maxAzimuthAngle = _opts.azimuthAngle[1];
		}
	}
	
	function setControlsOff ( controls ) {
		controls.enablePan = false;
		controls.enableKeys = false;
		controls.enableZoom = false;
		controls.enableRotate = false;
	}
	
	function setLight ( scene, opts ) {
        console.log('setLight');
		scene.add( new THREE.AmbientLight(opts.Ambient.color, opts.Ambient.strength) );
		if ( opts.isHemisphere ) {
			var lh = opts.hemisphere,
				hLight = new THREE.HemisphereLight( lh.color, lh.groundColor, lh.strength );
			hLight.position.set( lh.position[0], lh.position[2], lh.position[1] );
			scene.add( hLight );
		}
		if ( opts.isDirectional ) {
			var ld = opts.directional,
				dlight = new THREE.DirectionalLight( ld.color, ld.strength );
			dlight.position.set( ld.position[0], ld.position[2], ld.position[1] ).normalize();
			scene.add( dlight );
		}
	}
	
	function detector () { 
		try { 
			return !! window.WebGLRenderingContext && !! document.createElement('canvas').getContext('experimental-webgl'); 
		} catch( e ) { return false; } 
	}
	
	function isArray ( o ){
		return Object.prototype.toString.call(o)=='[object Array]';
	}
	
	function isFunction ( a ) {
		return Object.prototype.toString.call(a) === '[object Function]';
	}
	
	function toFunction ( a ) {
		var b = Object.prototype.toString.call(a) === '[object Function]';
		return b? a: function(o){};
	}
	
	function parseCts ( cts ) {
		var $dom = ( typeof cts == 'object' )? $(cts): $('#'+cts);
		if ( $dom.length <= 0 ) return null;
		return $dom;
	}
	
	function removeEvent () {
		thm.container[0].removeEventListener( 'mouseup', onDocumentMouseUp, false );
		thm.container[0].removeEventListener( 'wheel', onDocumentMouseWheel, false );
		thm.container[0].removeEventListener( 'mouseout', onDocumentMouseOut, false );
		thm.container[0].removeEventListener( 'mousemove', onDocumentMouseMove, false );
		thm.container[0].removeEventListener( 'mousedown', onDocumentMouseDown, false );
	}
	
	function transCoord ( position ) {
		var halfW = df_Width/2, halfH = df_Height/2,
			vec3 = position.clone().applyMatrix4( thm.scene.matrix ).project( thm.camera ),
			mx = Math.round( vec3.x * halfW + halfW ),
			my = Math.round( -vec3.y * halfH + halfH );
		return new THREE.Vector2(mx, my);
	}
	
	// Container
	function creatContainer ( id ) {
		var containers = $('<div></div>');
		containers.css("cssText", "height:100%;width:100%;overflow:hidden;position:relative !important");
		containers.attr('id', id);
		return containers;
	}
	
	function creatError ( conts, errorText ) {
		var error = $('<div class="data-error"></div>'), 
			error_text = errorText || '数据错误。。。';		
		if( undefined != conts ) {
			var ctxt = "color:#fff;position:absolute;top:49%;width:100%;text-align:center;";
			error.css("cssText", ctxt);
			conts.html( error.html(error_text) );
		}
	}

};

function __setPlugsIN() {
	THREE.OrbitControls=function(F,G){function h(){return Math.pow(.95,a.zoomSpeed)}function z(b){a.object instanceof THREE.PerspectiveCamera?k/=b:a.object instanceof THREE.OrthographicCamera?(a.object.zoom=Math.max(a.minZoom,Math.min(a.maxZoom,a.object.zoom*b)),a.object.updateProjectionMatrix(),y=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),a.enableZoom=!1)}function A(b){a.object instanceof THREE.PerspectiveCamera?k*=b:a.object instanceof THREE.OrthographicCamera?
	(a.object.zoom=Math.max(a.minZoom,Math.min(a.maxZoom,a.object.zoom/b)),a.object.updateProjectionMatrix(),y=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),a.enableZoom=!1)}function H(b){if(!1!==a.enabled){b.preventDefault();if(b.button===a.mouseButtons.ORBIT){if(!1===a.enableRotate)return;l.set(b.clientX,b.clientY);d=c.ROTATE}else if(b.button===a.mouseButtons.ZOOM){if(!1===a.enableZoom)return;m.set(b.clientX,b.clientY);d=c.DOLLY}else if(b.button===
	a.mouseButtons.PAN){if(!1===a.enablePan)return;n.set(b.clientX,b.clientY);d=c.PAN}d!==c.NONE&&(document.addEventListener("mousemove",B,!1),document.addEventListener("mouseup",C,!1),a.dispatchEvent(D))}}function B(b){!1!==a.enabled&&(b.preventDefault(),d===c.ROTATE?!1!==a.enableRotate&&(p.set(b.clientX,b.clientY),q.subVectors(p,l),b=a.domElement===document?a.domElement.body:a.domElement,e.theta-=2*Math.PI*q.x/b.clientWidth*a.rotateSpeed,e.phi-=2*Math.PI*q.y/b.clientHeight*a.rotateSpeed,l.copy(p),a.update()):
	d===c.DOLLY?!1!==a.enableZoom&&(r.set(b.clientX,b.clientY),t.subVectors(r,m),0<t.y?z(h()):0>t.y&&A(h()),m.copy(r),a.update()):d===c.PAN&&!1!==a.enablePan&&(u.set(b.clientX,b.clientY),v.subVectors(u,n).multiplyScalar(a.panSpeed),w(v.x,v.y),n.copy(u),a.update()))}function C(b){!1!==a.enabled&&(document.removeEventListener("mousemove",B,!1),document.removeEventListener("mouseup",C,!1),a.dispatchEvent(E),d=c.NONE)}function I(b){!1===a.enabled||!1===a.enableZoom||d!==c.NONE&&d!==c.ROTATE||(b.preventDefault(),
	b.stopPropagation(),0>b.deltaY?A(h()):0<b.deltaY&&z(h()),a.update(),a.dispatchEvent(D),a.dispatchEvent(E))}function J(b){if(!1!==a.enabled&&!1!==a.enableKeys&&!1!==a.enablePan)switch(b.keyCode){case a.keys.UP:w(0,7*-a.panSpeed);a.update();break;case a.keys.BOTTOM:w(0,7*a.panSpeed);a.update();break;case a.keys.LEFT:w(7*-a.panSpeed,0);a.update();break;case a.keys.RIGHT:w(7*a.panSpeed,0),a.update()}}function K(b){if(!1!==a.enabled){switch(b.touches.length){case 1:if(!1===a.enableRotate)return;l.set(b.touches[0].pageX,
	b.touches[0].pageY);d=c.TOUCH_ROTATE;break;case 2:if(!1===a.enableZoom)return;var g=b.touches[0].pageX-b.touches[1].pageX;b=b.touches[0].pageY-b.touches[1].pageY;m.set(0,Math.sqrt(g*g+b*b));d=c.TOUCH_DOLLY;break;case 3:if(!1===a.enablePan)return;n.set(b.touches[0].pageX,b.touches[0].pageY);d=c.TOUCH_PAN;break;default:d=c.NONE}d!==c.NONE&&a.dispatchEvent(D)}}function L(b){if(!1!==a.enabled)switch(b.preventDefault(),b.stopPropagation(),b.touches.length){case 1:if(!1===a.enableRotate)break;if(d!==c.TOUCH_ROTATE)break;
	p.set(b.touches[0].pageX,b.touches[0].pageY);q.subVectors(p,l);var g=a.domElement===document?a.domElement.body:a.domElement;e.theta-=2*Math.PI*q.x/g.clientWidth*a.rotateSpeed;e.phi-=2*Math.PI*q.y/g.clientHeight*a.rotateSpeed;l.copy(p);a.update();break;case 2:if(!1===a.enableZoom)break;if(d!==c.TOUCH_DOLLY)break;g=b.touches[0].pageX-b.touches[1].pageX;b=b.touches[0].pageY-b.touches[1].pageY;r.set(0,Math.sqrt(g*g+b*b));t.subVectors(r,m);0<t.y?A(h()):0>t.y&&z(h());m.copy(r);a.update();break;case 3:if(!1===
	a.enablePan)break;if(d!==c.TOUCH_PAN)break;u.set(b.touches[0].pageX,b.touches[0].pageY);v.subVectors(u,n);w(v.x,v.y);n.copy(u);a.update();break;default:d=c.NONE}}function M(b){!1!==a.enabled&&(a.dispatchEvent(E),d=c.NONE)}function N(a){a.preventDefault()}this.object=F;this.domElement=void 0!==G?G:document;this.enabled=!0;this.target=new THREE.Vector3;this.minDistance=0;this.maxDistance=Infinity;this.minZoom=0;this.maxZoom=Infinity;this.minPolarAngle=0;this.maxPolarAngle=Math.PI;this.minAzimuthAngle=
	-Infinity;this.maxAzimuthAngle=Infinity;this.enableDamping=!1;this.dampingFactor=.25;this.enableZoom=!0;this.zoomSpeed=1;this.enableRotate=!0;this.rotateSpeed=1;this.enablePan=!0;this.panSpeed=1;this.autoRotate=!1;this.autoRotateSpeed=2;this.enableKeys=!0;this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40};this.mouseButtons={ORBIT:THREE.MOUSE.LEFT,ZOOM:THREE.MOUSE.MIDDLE,PAN:THREE.MOUSE.RIGHT};this.target0=this.target.clone();this.position0=this.object.position.clone();this.zoom0=this.object.zoom;this.getPolarAngle=
	function(){return f.phi};this.getAzimuthalAngle=function(){return f.theta};this.reset=function(){a.target.copy(a.target0);a.object.position.copy(a.position0);a.object.zoom=a.zoom0;a.object.updateProjectionMatrix();a.dispatchEvent(O);a.update();d=c.NONE};this.update=function(){var b=new THREE.Vector3,g=(new THREE.Quaternion).setFromUnitVectors(F.up,new THREE.Vector3(0,1,0)),U=g.clone().inverse(),P=new THREE.Vector3,Q=new THREE.Quaternion;return function(){var h=a.object.position;b.copy(h).sub(a.target);
	b.applyQuaternion(g);f.setFromVector3(b);a.autoRotate&&d===c.NONE&&(e.theta-=2*Math.PI/60/60*a.autoRotateSpeed);f.theta+=e.theta;f.phi+=e.phi;f.theta=Math.max(a.minAzimuthAngle,Math.min(a.maxAzimuthAngle,f.theta));f.phi=Math.max(a.minPolarAngle,Math.min(a.maxPolarAngle,f.phi));f.makeSafe();f.radius*=k;f.radius=Math.max(a.minDistance,Math.min(a.maxDistance,f.radius));a.target.add(x);b.setFromSpherical(f);b.applyQuaternion(U);h.copy(a.target).add(b);a.object.lookAt(a.target);!0===a.enableDamping?(k+=
	(1-k)*a.dampingFactor*.6,e.theta*=1-a.dampingFactor,e.phi*=1-a.dampingFactor,x.multiplyScalar(1-a.dampingFactor)):(k=1,e.set(0,0,0),x.set(0,0,0));return y||P.distanceToSquared(a.object.position)>R||8*(1-Q.dot(a.object.quaternion))>R?(a.dispatchEvent(O),P.copy(a.object.position),Q.copy(a.object.quaternion),y=!1,!0):!1}}();this.dispose=function(){a.domElement.removeEventListener("contextmenu",N,!1);a.domElement.removeEventListener("mousedown",H,!1);a.domElement.removeEventListener("wheel",I,!1);a.domElement.removeEventListener("touchstart",
	K,!1);a.domElement.removeEventListener("touchend",M,!1);a.domElement.removeEventListener("touchmove",L,!1);document.removeEventListener("mousemove",B,!1);document.removeEventListener("mouseup",C,!1);window.removeEventListener("keydown",J,!1)};var a=this,O={type:"change"},D={type:"start"},E={type:"end"},c={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},d=c.NONE,R=1E-6,f=new THREE.Spherical,e=new THREE.Spherical,k=1,x=new THREE.Vector3,y=!1,l=new THREE.Vector2,p=new THREE.Vector2,
	q=new THREE.Vector2,n=new THREE.Vector2,u=new THREE.Vector2,v=new THREE.Vector2,m=new THREE.Vector2,r=new THREE.Vector2,t=new THREE.Vector2,S=function(){var a=new THREE.Vector3;return function(b,c){a.setFromMatrixColumn(c,0);a.multiplyScalar(-b);x.add(a)}}(),T=function(){var a=new THREE.Vector3;return function(b,c){a.setFromMatrixColumn(c,1);a.multiplyScalar(b);x.add(a)}}(),w=function(){var b=new THREE.Vector3;return function(c,d){var e=a.domElement===document?a.domElement.body:a.domElement;if(a.object instanceof
	THREE.PerspectiveCamera){b.copy(a.object.position).sub(a.target);var f=b.length(),f=f*Math.tan(a.object.fov/2*Math.PI/180);S(2*c*f/e.clientHeight,a.object.matrix);T(2*d*f/e.clientHeight,a.object.matrix)}else a.object instanceof THREE.OrthographicCamera?(S(c*(a.object.right-a.object.left)/a.object.zoom/e.clientWidth,a.object.matrix),T(d*(a.object.top-a.object.bottom)/a.object.zoom/e.clientHeight,a.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),
	a.enablePan=!1)}}();a.domElement.addEventListener("contextmenu",N,!1);a.domElement.addEventListener("mousedown",H,!1);a.domElement.addEventListener("wheel",I,!1);a.domElement.addEventListener("touchstart",K,!1);a.domElement.addEventListener("touchend",M,!1);a.domElement.addEventListener("touchmove",L,!1);window.addEventListener("keydown",J,!1);this.update()};THREE.OrbitControls.prototype=Object.create(THREE.EventDispatcher.prototype);THREE.OrbitControls.prototype.constructor=THREE.OrbitControls;
}

var _CoordTrans = function(){

	this.mercatorRatio = [];
	this.init = function(jwOpts,xyOpts){
		 
        if(jwOpts.length<3||xyOpts.length<3) {
        	// console.log("初始化需要三对坐标");
        	return;
        }
        var defaultMapData = {  
            WTCoords:[],            
            XYCoords:[],  
        };  
        for(var i =0;i<3;i++){
        	defaultMapData.WTCoords.push({W:jwOpts[i][0],T:jwOpts[i][1]});
        	defaultMapData.XYCoords.push({X:xyOpts[i][0],Y:xyOpts[i][1]});
        }
		initRelativeCoorRatio(defaultMapData);
	};
	this.calRelativeCoor=function(lng,lat){
    	//var mercator = Common.bd09toMercator(lng,lat);
    	var mercator = [lng,lat];
    	var mercatorRatio = thm.mercatorRatio;
    	var x = mercatorRatio[0][0]+mercatorRatio[0][1]*mercator[0]+mercatorRatio[0][2]*mercator[1];
    	var y = mercatorRatio[1][0]+mercatorRatio[1][1]*mercator[0]+mercatorRatio[1][2]*mercator[1];
    	return [x,y];
    }	
	
	var thm = this;
	function initRelativeCoorRatio(opts){    	
        var lonlat = opts.WTCoords;
        var xy = opts.XYCoords;
        
        var lon0 = lonlat[0].W,lat0 = lonlat[0].T,
            lon1 = lonlat[1].W,lat1 = lonlat[1].T,
            lon2 = lonlat[2].W,lat2 = lonlat[2].T;

        var x0 = xy[0].X,y0 = xy[0].Y,
            x1 = xy[1].X,y1 = xy[1].Y,
            x2 = xy[2].X,y2 = xy[2].Y;
       

        var mercator0X = lon0,mercator0Y = lat0,
	        mercator1X = lon1,mercator1Y = lat1,
	        mercator2X = lon2,mercator2Y = lat2;

	    var a2 = ((x0-x1)*(mercator0X-mercator2X)-(x0-x2)*(mercator0X-mercator1X))/((mercator0Y-mercator1Y)*(mercator0X-mercator2X)-(mercator0Y-mercator2Y)*(mercator0X-mercator1X));
	    var a1 = ((x0-x1)-a2*(mercator0Y-mercator1Y))/(mercator0X-mercator1X);
	    var a0 = x0-mercator0X*a1-mercator0Y*a2;

	    var b2 = ((y0-y1)*(mercator0X-mercator2X)-(y0-y2)*(mercator0X-mercator1X))/((mercator0Y-mercator1Y)*(mercator0X-mercator2X)-(mercator0Y-mercator2Y)*(mercator0X-mercator1X));
	    var b1 = ((y0-y1)-b2*(mercator0Y-mercator1Y))/(mercator0X-mercator1X);
	    var b0 = y0-mercator0X*b1-mercator0Y*b2;

       	thm.mercatorRatio[0] = [a0,a1,a2];
        thm.mercatorRatio[1] = [b0,b1,b2];
	}
	
};

(function(l,u,p){ 
    u[l]=p()
})("HEATMap",this,function(){
    var l={
        defaultRadius:40,
        defaultRenderer:"canvas2d",
        // defaultGradient:{"0.25":"rgb(0,0,255)","0.55":"rgb(0,255,0)","0.85":"yellow",1:"rgb(255,0,0)"},
        defaultGradient: {'0.2':'#2c7bb6', '0.4':'#abd9e9', '0.6':'#ffffbf', '0.8':'#fde468', '1.0':'#d7191c'},
        defaultMaxOpacity:1,
        defaultMinOpacity:0,
        defaultBlur:.85,
        defaultXField:"x",
        defaultYField:"y",
        defaultValueField:"value",
        plugins:{}
    },
    u=function(){
        var f=function(b){
            this._coordinator={};
            this._data=[];
            this._radi=[];
            this._min=10;
            this._max=1;
            this._xField=b.xField||b.defaultXField;
            this._yField=b.yField||b.defaultYField;
            this._valueField=b.valueField||b.defaultValueField;
            b.radius&&(this._cfgRadius=b.radius)},h=l.defaultRadius;
            f.prototype={
                _organiseData:function(b,a){
                    var c=b[this._xField],
                        e=b[this._yField],
                        d=this._radi,
                        r=this._data,
                        g=this._max,
                        n=this._min,
                        f=b[this._valueField]||1;
                    b=b.radius||this._cfgRadius||h;
                    r[c]||(r[c]=[],d[c]=[]);
                    r[c][e]?r[c][e]+=f:(r[c][e]=f,d[c][e]=b);
                    d=r[c][e];return d>g?(a?
this.setDataMax(d):this._max=d,!1):d<n?(a?this.setDataMin(d):this._min=d,!1):{x:c,y:e,value:f,radius:b,min:n,max:g}},_unOrganizeData:function(){var b=[],a=this._data,c=this._radi,e;for(e in a)for(var d in a[e])b.push({x:e,y:d,radius:c[e][d],value:a[e][d]});return{min:this._min,max:this._max,data:b}},_onExtremaChange:function(){this._coordinator.emit("extremachange",{min:this._min,max:this._max})},addData:function(b){if(0<b.length)for(var a=b.length;a--;)this.addData.call(this,b[a]);else if(b=this._organiseData(b,
!0))0===this._data.length&&(this._min=this._max=b.value),this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[b]});return this},setData:function(b){var a=b.data,c=a.length;this._data=[];this._radi=[];for(var e=0;e<c;e++)this._organiseData(a[e],!1);this._max=b.max;this._min=b.min||0;this._onExtremaChange();this._coordinator.emit("renderall",this._getInternalData());return this},removeData:function(){},setDataMax:function(b){this._max=b;this._onExtremaChange();this._coordinator.emit("renderall",
this._getInternalData());return this},setDataMin:function(b){this._min=b;this._onExtremaChange();this._coordinator.emit("renderall",this._getInternalData());return this},setCoordinator:function(b){this._coordinator=b},_getInternalData:function(){return{max:this._max,min:this._min,data:this._data,radi:this._radi}},getData:function(){return this._unOrganizeData()}};return f}(),p=function(){function f(a){var c=a.container,e=this.shadowCanvas=document.createElement("canvas"),d=this.canvas=a.canvas||document.createElement("canvas");
this._renderBoundaries=[1E4,1E4,0,0];var b=getComputedStyle(a.container)||{};d.className="heatmap-canvas";this._width=d.width=e.width=a.width||+b.width.replace(/px/,"");this._height=d.height=e.height=a.height||+b.height.replace(/px/,"");this.shadowCtx=e.getContext("2d");this.ctx=d.getContext("2d");d.style.cssText=e.style.cssText="position:absolute;left:0;top:0;";c.style.position="relative";c.appendChild(d);this._palette=h(a);this._templates={};this._setStyles(a)}var h=function(a){a=a.gradient||a.defaultGradient;
var c=document.createElement("canvas"),e=c.getContext("2d");c.width=256;c.height=1;c=e.createLinearGradient(0,0,256,1);for(var b in a)c.addColorStop(b,a[b]);e.fillStyle=c;e.fillRect(0,0,256,1);return e.getImageData(0,0,256,1).data},b=function(a){var c=[],b=a.min,d=a.max,r=a.radi;a=a.data;for(var g=Object.keys(a),f=g.length;f--;)for(var x=g[f],q=Object.keys(a[x]),h=q.length;h--;){var k=q[h];c.push({x:x,y:k,value:a[x][k],radius:r[x][k]})}return{min:b,max:d,data:c}};f.prototype={renderPartial:function(a){0<
a.data.length&&(this._drawAlpha(a),this._colorize())},renderAll:function(a){this._clear();0<a.data.length&&(this._drawAlpha(b(a)),this._colorize())},_updateGradient:function(a){this._palette=h(a)},updateConfig:function(a){a.gradient&&this._updateGradient(a);this._setStyles(a)},setDimensions:function(a,c){this._width=a;this._height=c;this.canvas.width=this.shadowCanvas.width=a;this.canvas.height=this.shadowCanvas.height=c},_clear:function(){this.shadowCtx.clearRect(0,0,this._width,this._height);this.ctx.clearRect(0,
0,this._width,this._height)},_setStyles:function(a){this._blur=0==a.blur?0:a.blur||a.defaultBlur;a.backgroundColor&&(this.canvas.style.backgroundColor=a.backgroundColor);this._width=this.canvas.width=this.shadowCanvas.width=a.width||this._width;this._height=this.canvas.height=this.shadowCanvas.height=a.height||this._height;this._opacity=255*(a.opacity||0);this._maxOpacity=255*(a.maxOpacity||a.defaultMaxOpacity);this._minOpacity=255*(a.minOpacity||a.defaultMinOpacity);this._useGradientOpacity=!!a.useGradientOpacity},
_drawAlpha:function(a){var c=this._min=a.min,b=this._max=a.max;a=a.data||[];for(var d=a.length,f=1-this._blur;d--;){var g=a[d],n=g.radius,h=Math.min(g.value,b),q=g.x-n;g=g.y-n;var l=this.shadowCtx;if(this._templates[n])var k=this._templates[n];else{k=this._templates;var t=n,m=n,w=f,p=document.createElement("canvas"),v=p.getContext("2d"),u=m,y=m;p.width=p.height=2*m;1==w?(v.beginPath(),v.arc(u,y,m,0,2*Math.PI,!1),v.fillStyle="rgba(0,0,0,1)",v.fill()):(w=v.createRadialGradient(u,y,m*w,u,y,m),w.addColorStop(0,
"rgba(0,0,0,1)"),w.addColorStop(1,"rgba(0,0,0,0)"),v.fillStyle=w,v.fillRect(0,0,2*m,2*m));k[t]=k=p}h=(h-c)/(b-c);l.globalAlpha=.01>h?.01:h;l.drawImage(k,q,g);q<this._renderBoundaries[0]&&(this._renderBoundaries[0]=q);g<this._renderBoundaries[1]&&(this._renderBoundaries[1]=g);q+2*n>this._renderBoundaries[2]&&(this._renderBoundaries[2]=q+2*n);g+2*n>this._renderBoundaries[3]&&(this._renderBoundaries[3]=g+2*n)}},_colorize:function(){var a=this._renderBoundaries[0],c=this._renderBoundaries[1],b=this._renderBoundaries[2]-
a,d=this._renderBoundaries[3]-c,f=this._width,g=this._height,h=this._opacity,l=this._maxOpacity,q=this._minOpacity,p=this._useGradientOpacity;0>a&&(a=0);0>c&&(c=0);a+b>f&&(b=f-a);c+d>g&&(d=g-c);b=this.shadowCtx.getImageData(a,c,b,d);d=b.data;f=d.length;g=this._palette;for(var k=3;k<f;k+=4){var t=d[k],m=4*t;m&&(t=0<h?h:t<l?t<q?q:t:l,d[k-3]=g[m],d[k-2]=g[m+1],d[k-1]=g[m+2],d[k]=p?g[m+3]:t)}b.data=d;this.ctx.putImageData(b,a,c);this._renderBoundaries=[1E3,1E3,0,0]},getValueAt:function(a){a=this.shadowCtx.getImageData(a.x,
a.y,1,1).data[3];return a/255*Math.abs(this._max-this._min)>>0},getDataURL:function(){return this.canvas.toDataURL()}};return f}(),A=function(){var f=!1;"canvas2d"===l.defaultRenderer&&(f=p);return f}(),z={merge:function(){for(var f={},h=arguments.length,b=0;b<h;b++){var a=arguments[b],c;for(c in a)f[c]=a[c]}return f}},B=function(){function f(a){a=this._config=z.merge(l,a||{});this._coordinator=new h;if(a.plugin){var c=a.plugin;if(l.plugins[c])c=l.plugins[c],this._renderer=new c.renderer(a),this._store=
new c.store(a);else throw Error("Plugin '"+c+"' not found. Maybe it was not registered.");}else this._renderer=new A(a),this._store=new u(a);b(this)}var h=function(){function a(){this.cStore={}}a.prototype={on:function(a,b,d){var c=this.cStore;c[a]||(c[a]=[]);c[a].push(function(a){return b.call(d,a)})},emit:function(a,b){var c=this.cStore;if(c[a])for(var f=c[a].length,e=0;e<f;e++)(0,c[a][e])(b)}};return a}(),b=function(a){var b=a._renderer,e=a._coordinator,d=a._store;e.on("renderpartial",b.renderPartial,
b);e.on("renderall",b.renderAll,b);e.on("extremachange",function(b){a._config.onExtremaChange&&a._config.onExtremaChange({min:b.min,max:b.max,gradient:a._config.gradient||a._config.defaultGradient})});d.setCoordinator(e)};f.prototype={addData:function(){this._store.addData.apply(this._store,arguments);return this},removeData:function(){this._store.removeData&&this._store.removeData.apply(this._store,arguments);return this},setData:function(){this._store.setData.apply(this._store,arguments);return this},
setDataMax:function(){this._store.setDataMax.apply(this._store,arguments);return this},setDataMin:function(){this._store.setDataMin.apply(this._store,arguments);return this},configure:function(a){this._config=z.merge(this._config,a);this._renderer.updateConfig(this._config);this._coordinator.emit("renderall",this._store._getInternalData());return this},repaint:function(){this._coordinator.emit("renderall",this._store._getInternalData());return this},getData:function(){return this._store.getData()},
getDataURL:function(){return this._renderer.getDataURL()},getValueAt:function(a){return this._store.getValueAt?this._store.getValueAt(a):this._renderer.getValueAt?this._renderer.getValueAt(a):null}};return f}();return{create:function(f){return new B(f)},register:function(f,h){l.plugins[f]=h}}});
